Getting 'psutil.AccessDenied (pid=6836)' error using psutil
I want to check if a program is running or not, so I searched and I tried this , in this way: import psutil if "notepad.exe" in (p.name() for p in psutil.process_iter()): print('program is running') else: print('not running') but I get this error: During handling of the above exception, another exception occurred: Traceback (most recent call last): File "~/temp.py", line 2, in <module> if "notepad.exe" in (p.name() for p in psutil.process_iter()): File "~/temp.py", line 2, in <genexpr> if "notepad.exe" in (p.name() for p in psutil.process_iter()): File "~\Python\Python38-32\lib\site-packages\p
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.