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
It's not entirely clear what you mean by "the filepath of the file that is currently running within the process".
sys.argv[0]
usually contains the location of the script that was invoked by the Python interpreter.
Check the sys documentation for more details.
As @Tim and @Pat Notz have pointed out, the __file__ attribute provides access to
the file from which the module was loaded, if it was loaded from a file