get line number and filename in a source file

2009-11-24 Thread Peng Yu
__LINE__ __FILE__ in C++ can give the current line number and filename. Is there a similar thing in python that can give me the current line number and filename? Is there a similar thing to __PRETTY_FUNCTION__ (also from C++)? -- http://mail.python.org/mailman/listinfo/python-list

Re: get line number and filename in a source file

2009-11-24 Thread Chris Rebert
On Tue, Nov 24, 2009 at 9:47 PM, Peng Yu pengyu...@gmail.com wrote: __LINE__ __FILE__ in C++ can give the current line number and filename. Is there a similar thing in python that can give me the current line number and filename? import inspect filename, linenum, funcname =

Re: get line number and filename in a source file

2009-11-24 Thread Rami Chowdhury
On Nov 24, 2009, at 21:47 , Peng Yu wrote: __LINE__ __FILE__ in C++ can give the current line number and filename. Is there a similar thing in python that can give me the current line number and filename? Is there a similar thing to __PRETTY_FUNCTION__ (also from C++)? What do you want to

Re: get line number and filename in a source file

2009-11-24 Thread Dave Angel
Peng Yu wrote: __LINE__ __FILE__ in C++ can give the current line number and filename. Is there a similar thing in python that can give me the current line number and filename? Is there a similar thing to __PRETTY_FUNCTION__ (also from C++)? mod.__name__ gives the module name, and