python中如何结束另一个程序的任务?
当您转到任务管理器并选择一个应用程序并按“结束任务”时,该程序将关闭。 我怎样才能在Python中完成这个过程?例如,当代码运行时,Chrome 应用程序将关闭。
When you go to Task Manager and select an app and press "End Task", the program closes.
How can I do this process in python? So when the code runs, for example, the Chrome app closes.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
与此相关的几个链接:(1)
使用 os 包终止进程 (2) 使用以下命令终止进程windows中的wmi包
Couple of links related to this: (1)
kill process using os package (2) Kill process using wmi package in windows
No.6278847 的克隆:是吗可以从 Python 中终止 Windows 上的进程吗?
您可以通过以下代码来做到这一点:
鸣谢:Nix
Clone of No.6278847: Is it possible to kill a process on Windows from within Python?
You can do that through the following code:
Credits: Nix