用python监控程序启动。像这样尝试:
import subprocess
import time
while True:
time.sleep(1)
if subprocess.Popen("zathura", shell=True):
print("Zathura app was started.Let's do something...")
else:
print("Nothing interesting.")
用python监控程序启动。像这样尝试:
import subprocess
import time
while True:
time.sleep(1)
if subprocess.Popen("zathura", shell=True):
print("Zathura app was started.Let's do something...")
else:
print("Nothing interesting.")
您可以使用psutil模块。
更多示例:过滤和排序过程。