How to get filename of the __main__ module in Python?

import __main__
print(__main__.__file__)

Leave a Comment