我在windows8.1的python 64位上使用psutil 2.1.2。我使用psutil.process_iter()遍历正在运行的进程,以获取特定进程的详细信息。由于某些原因,我无法获得流程,即使它显示在任务管理器和流程资源管理器中
for proc in psutil.process_iter():
try:
if proc.name() == 'svchost.exe': # patch for debugging
pass #script never gets here
opened_file
我花了很多时间去寻找我的问题的答案,但我找不到。
我使用subrocess运行xdm-打开,以播放视频(我不想知道可用的应用程序)
我在等一段时间
我想杀了视频
import os
import subprocess
import psutil
from time import sleep;
from signal import SIGTERM
file = "test.mkv"
out = subprocess.Popen(['xdg-open', file])
pid = out.pid
print('sleeping...&