0

I am currently running a script which while execution goes to multiple other python files. My aim is to print the filename of the currently executing file in python ?

I tried using:

print __file__

But the following error was thrown:

Traceback (most recent call last):
  File "C:\Users\qksr\Desktop\work\parsing text\testcase.py", line 32, in <module>
    print __file__
NameError: name '__file__' is not defined

So what statement should i code ?

Kaushik
  • 1,194
  • 7
  • 19
  • 31

0 Answers0