Skip to content
Advertisement

Tag: pid

How to find pid of a process by Python?

friends: I am running a script in Linux: I can use the ps command get the process. but, how can I know the pid of the running script by given key word python test09.py& using python code? EDIT-01 I mean, I want to use the python script to find the running script python test09.py&’s pid. EDIT-02 When I run anali’s

How to get PID by process name?

Is there any way I can get the PID by process name in Python? For example I need to get 3110 by chrome. Answer You can get the pid of processes by name using pidof through subprocess.check_output: check_output([“pidof”,name]) will run the command as “pidof process_name”, If the return code was non-zero it raises a CalledProcessError. To handle multiple entries and

Advertisement