Skip to content
Advertisement

How do I remove the file path from the console window of python exe file?

enter image description hereI have made a simple “Hello World” app in python and turned it into a standalone exe file using pyinstaller. The problem is, the title bar of the console always shows the file path of the exe file. Is there any way to remove the filepath from the window? here is the image

Advertisement

Answer

Change the name of the console window in the code

import os
os.system('title MyTitleHere')

If you are using a GUI as part of your program, you can set the title (and icon) there, but for a console-based output, this is the best option. There is no .spec file option to do this.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement