I have scripts calling other script files but I need to get the filepath of the file that is currently running within the process.
For example, let\'s say I have th
You can use inspect.stack()
inspect.stack()
import inspect,os inspect.stack()[0] => (, 'g:\\Python\\Test\\_GetCurrentProgram.py', 15, '', ['print inspect.stack()[0]\n'], 0) os.path.abspath (inspect.stack()[0][1]) => 'g:\\Python\\Test\\_GetCurrentProgram.py'