Change process name of Python script

匿名 (未验证) 提交于 2019-12-03 08:36:05

问题:

Windows Task Manager lists all running processes in the "Processes" tab. The image name of Python scripts is always python.exe, or pythonw.exe, or the name of the Python interpreter.

Is there a nice way to change the image name of a Python script, other than changing the name of the Python interpreter?

回答1:

There's no nice way that I've found to change the name of a running process in Windows, but you can create small .exe stubs with ExeMaker rather than resorting to py2exe packaging or copying the interpreter

The exe stub uses its own module name to calculate the .py script invoked. You should be able to use an exe resource editor to change the icon.



回答2:

You could use py2exe to turn your Python program into a self-contained executable with whatever name that you choose to give it.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!