Klovik
Klovik

Reputation: 73

Can python script converted to exe get it's name?

When i have python code (sample.py). Where is just code Print(__file__), the output is sample.py. When i convert it to exe with auto-py-to-exe (it name will be sample2.exe) the output is sample.py and not sample2.exe. How can i print sample2.exe?

Upvotes: 1

Views: 51

Answers (1)

Klovik
Klovik

Reputation: 73

import sys
print((sys.executable))

Upvotes: 1

Related Questions