aotumandaren

Windows 10操作系统

python idle

原理:

调用windows系统自带的命令task,该命令使用方式:

第一步、调用cmd命令行,显示当前系统中所有进程;

    Win+R->cmd->(input)tasklist

第二步、调用taskkill命令,关闭指定的进程;

taskkill [/S system [/U username [/P [password]]]]

            {[/FI filter] [/PID processid] | /IM imagename} [/T] [/F]

常用调用方式为:

进程终止过程示例:

##假定关闭进程SougouCloud.exe

一、window10 cmd命令行中

C:\User\username\ tasklist            ##显示的列表中查看是否找到SougouCloud.exe
C:\User\username\ taskkill /IM SougouCloud.exe /F

二、python idle中

>>>import os
>>>print(os.popen(\'tasklist\'))
>>>os.system(\'taskkill /IM SougouCloud.exe /F\')

转载:https://www.cnblogs.com/guohu/p/11287103.html

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-25
  • 2022-12-23
  • 2021-10-01
  • 2021-12-05
猜你喜欢
  • 2021-11-29
  • 2022-12-23
  • 2022-01-06
  • 2021-11-02
  • 2022-02-24
  • 2021-11-08
相关资源
相似解决方案