Created
October 18, 2018 23:53
-
-
Save R4wm/d3ba9a2fa082fa9c32be3908a351dd39 to your computer and use it in GitHub Desktop.
Simple way of finding process by name without using subprocess
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import psutil | |
l_proc_list = psutil.get_process_list() | |
for i in l_proc_list: | |
if i.name == 'waflz_server': | |
print("FOUND WAFLZ_SERVER") | |
print(i.pid) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment