Below is a function to find the caller's file name, line number, etc.
inside Python. Maybe this works for your case.
/Jean Brouwers
- import traceback
-
- def caller(up=0):
- '''Get file name, line number, function name and
-source text of the caller's caller as 4-tuple:
-
Hello,
I implemented some Python functions in my C/C++ code. I need to know the Python source file name and line number of just executed
Python command which calls my function.
How can I get this information inside my C/C++ function?
Thanks for any help.
Marek
--
http://mail.python.org/mailman/