首页
注册
登录
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请
登录
推荐学习书目
›
Learn Python the Hard Way
Python Sites
›
PyPI
- Python Package Index
›
http://diveintopython.org/toc/index.html
›
Pocoo
值得关注的项目
›
PyPy
›
Celery
›
Jinja2
›
Read the Docs
›
gevent
›
pyenv
›
virtualenv
›
Stackless Python
›
Beautiful Soup
›
结巴中文分词
›
Green Unicorn
›
Sentry
›
Shovel
›
Pyflakes
›
pytest
Python 编程
›
pep8 Checker
Styles
›
PEP 8
›
Google Python Style Guide
›
Code Style from The Hitchhiker's Guide
V2EX
›
Python
被调用函数如何才能知道自己是被哪个函数调用的?
zyAndroid
·
2011-09-10 09:27:53 +08:00
· 5504 次点击
这是一个创建于 4930 天前的主题,其中的信息可能已经有所发展或是发生改变。
比如A函数和B函数都可能调用C函数来完某个功能
C函数内部是否有内置的变量记录了调用它的函数的信息,比如函数名什么的?
求解!
函数
调用
调用函数
3 条回复
•
1970-01-01 08:00:00 +08:00
1
lhj2100
2011-09-10 09:33:45 +08:00
我们这些初学者都是用数组的.
2
qiao
2011-09-10 09:42:08 +08:00
使用 inspect 模块的 getouterframes 方法。
文档参见:
http://docs.python.org/library/inspect.html#inspect.getouterframes
3
zyAndroid
OP
2011-09-10 09:52:39 +08:00
@
qiao
Thanks!
关于
·
帮助文档
·
博客
·
API
·
FAQ
·
实用小工具
·
1271 人在线
最高记录 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 22ms ·
UTC 17:43
·
PVG 01:43
·
LAX 10:43
·
JFK 13:43
Developed with
CodeLauncher
♥ Do have faith in what you're doing.