import inspect
def info(msg): frm = inspect.stack()[1] mod = inspect.getmodule(frm[0]) print '[%s] %s' % (mod.__name__, msg)
from: https://stackoverflow.com/questions/1095543/get-name-of-calling-functions-module-in-python
No comments:
Post a Comment