2010-06-29から1日間の記事一覧
import sys def foo(): this_fun_name=sys._getframe().f_code.co_name this_module=__import__(__name__, fromlist=['hoge']) print getattr(this_module, this_fun_name)走らせるとこうなる 私を呼んでいる関数も参照できる。 def bar(): fn=sys._getframe…
import sys def foo(): this_fun_name=sys._getframe().f_code.co_name this_module=__import__(__name__, fromlist=['hoge']) print getattr(this_module, this_fun_name)走らせるとこうなる 私を呼んでいる関数も参照できる。 def bar(): fn=sys._getframe…