Re: knowing the caller of an import && exec question

2010-09-07 Thread Bruno Desthuilliers
bussiere bussiere a écrit : i've got toto.py : import titi def niwhom(): pass and titi.py : def nipang(): pass how can i know in titi.py that's it's toto.py that is calling titi.py and the path of toto ? You'd have to inspect the call stack. Not for the faint at heart... And w

knowing the caller of an import && exec question

2010-09-07 Thread bussiere bussiere
i've got toto.py : import titi def niwhom(): pass and titi.py : def nipang(): pass how can i know in titi.py that's it's toto.py that is calling titi.py and the path of toto ? And why : bidule.py : class bidetmusique: pass truc.py : X = __import__("bidule") why exec("X