Advertisement
TTpocToXaKep

Process PID finding

Jan 31st, 2023
597
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. import psutil
  2.  
  3. process_name = "python" # here write process name
  4.  
  5. for proc in psutil.process_iter():
  6.     if proc.name() == process_name:
  7.         print(proc.pid)
  8.        
  9. # https://pastebin.com/u/TTpocToXaKep
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement