更改 Python 脚本的进程名称 [英] Change process name of Python script
问题描述
Windows 任务管理器在进程"选项卡中列出了所有正在运行的进程.Python 脚本的映像名称始终是 python.exe
或 pythonw.exe
,或 Python 解释器的名称.
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.
除了更改 Python 解释器的名称之外,有没有更好的方法来更改 Python 脚本的图像名称?
Is there a nice way to change the image name of a Python script, other than changing the name of the Python interpreter?
推荐答案
我发现没有什么好的方法可以更改 Windows 中正在运行的进程的名称,但是您可以使用 ExeMaker 而不是求助于 py2exe 打包或复制解释器
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
exe 存根使用自己的模块名称来计算调用的 .py 脚本.您应该可以使用 exe 资源编辑器来更改图标.
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.
这篇关于更改 Python 脚本的进程名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!