How to get filename of the __main__ module in Python? February 10, 2023 by Tarik import __main__ print(__main__.__file__)