[Tutor] how to determine where a module or function is called from

Alan Gauld alan.gauld at btinternet.com
Thu Feb 22 23:02:06 CET 2007

"Lance Haig" <lnhaig at gmail.com> wrote

>I am debugging a script that was written by someone else and I was
> wondering if there is a way to determine where a function or module 
> is
> imported from

>>> import time
>>> print time
<module 'time' from '/usr/lib/python2.4/lib-dynload/time.dll'>
>>> time.__file__


Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list