dylab/text2.py

14 lines
307 B
Python
Raw Normal View History

2022-08-10 16:40:15 +02:00
import psutil
def is_process_running(process_name):
pl = psutil.pids()
for pid in pl:
if psutil.Process(pid).name() == process_name:
print(pid)
print(psutil.Process(pid).cmdline())
# return True
return False
print(is_process_running('python.exe'))