농심짜파게티
농심짜파게티

Reputation: 95

Pyinstaller - Get exe file's name

[ I used translator ]

I want to get the name of the exe file made from Pyinstaller.

I tried os.path.basename(__file__) , but i returned python file's name(before using Pyinstaller).

I am sorry for my English and thank you

Upvotes: 0

Views: 1686

Answers (2)

Malou
Malou

Reputation: 151

os.path.basename(sys.executable)

Upvotes: 1

Mayank
Mayank

Reputation: 2013

Using pyinstaller to create .exe file, it will create the .exe file with the source code file name(ex- demo.py will produce demo.exe file at the output destination) if using --onefile and if you're using --onedir the .exe file will be stored with the same name as in --onefile but inside a folder with the same name, so the directory will be as follows: output_destination/demo/demo.exe

Upvotes: 0

Related Questions