guohu

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\')

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-05
  • 2021-11-08
  • 2021-05-16
  • 2021-07-31
  • 2021-06-27
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-29
  • 2021-07-08
  • 2021-12-14
  • 2021-05-17
  • 2022-12-23
  • 2021-05-31
相关资源
相似解决方案