python get name of current module code example
Example 1: get current module name python
print(__file__)
Example 2: python get module name
def main():
print('Running test...')
...
if __name__ == '__main__':
main()
print(__file__)
def main():
print('Running test...')
...
if __name__ == '__main__':
main()