תשובה אחת
import wmi

# initializing the wmi constructor
f = wmi.wmi()

# printing the header for the later columns
print("pid process name")

# iterating through all the running processes
for process in f.win32_process():

# displaying the p_id and p_name of the process
print(f"{process.processid:<10} {process.name}")