Directory
Hello. I am new to the Python language. I would like to know how to display and store the path of each mondule that is called. Similar to the old READY TRACE in COBOL of long ago. Thanks, George -- http://mail.python.org/mailman/listinfo/python-list
Re: Directory
On Feb 18, 3:39 pm, "Gabriel Genellina" wrote: > En Wed, 18 Feb 2009 12:15:25 -0200, Steve Holden > escribió: > > > gtillmon wrote: > >> I would like to know how to display and store the path of each mondule > >> that is called. > > It's certainly possible to trace function calls, if that would help. > > sys.settrace allows you to establish a function that gets called > > If the OP is only interested in import statements, perhaps the -v flag is > enough: > > python -v script_name.py > > It prints a line (on stderr) for each module imported, stating its name > and source file. > > -- > Gabriel Genellina Thanks for the information. -- http://mail.python.org/mailman/listinfo/python-list
Re: Directory
On Feb 18, 8:15 am, Steve Holden wrote: > gtillmon wrote: > > Hello. I am new to the Python language. > > I would like to know how to display and store the path of each mondule > > that is called. > > Modules are imported, not called. > > > Similar to the old READY TRACE in COBOL of long ago. > > It's certainly possible to trace function calls, if that would help. > sys.settrace allows you to establish a function that gets called > whenever a Python function call is executed. The documentation is a > little sparse, but you can find a rough example under "Crude Python > Debugging" in > > http://www.st.ewi.tudelft.nl/~mol/snippets.php > > regards > Steve > -- > Steve Holden +1 571 484 6266 +1 800 494 3119 > Holden Web LLC http://www.holdenweb.com/ Thanks for the information. -- http://mail.python.org/mailman/listinfo/python-list