Answer the question
In order to leave comments, you need to log in
How to get a list of running processes without using psutil?
I have a script:
for proc in psutil.process_iter():
if proc.name() == "print.exe":
exit(0)
Answer the question
In order to leave comments, you need to log in
Not the best way to prevent restart.
The program can, for example, open a certain file in exclusive mode. The second instance should try to open it and exit if it is blocked.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question