Reputation: 6061
I need to get process info by using PID
or Name
on Win 10, using only standard library.
Is this possible?
EDIT:
I meant all processes, not current...
Upvotes: 1
Views: 1130
Reputation: 2022
You can use subprocess
from subprocess import getoutput
process_info = getoutput('wmic process where "name like \'%{}%\'" get Caption,ExecutablePath,Processid,CommandLine'.format('chrome.exe'))
process_info = getoutput('wmic process where "ProcessID={}" get Caption,ExecutablePath,Processid,CommandLine'.format(14520))
Upvotes: 1