如何从 python exe 文件的控制台 window 中删除文件路径?
How do I remove the file path from the console window of python exe file?
I 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
在代码
中更改控制台的名称window
import os
os.system('title MyTitleHere')
如果您在程序中使用 GUI,您可以在那里设置标题(和图标),但对于 console-based 输出,这是最佳选择。没有 .spec 文件选项可以执行此操作。
在代码
中更改控制台的名称windowimport os
os.system('title MyTitleHere')
如果您在程序中使用 GUI,您可以在那里设置标题(和图标),但对于 console-based 输出,这是最佳选择。没有 .spec 文件选项可以执行此操作。