Currently i can list my processes with a simple python script:
import os os.system("Tasklist")
I would like to list all the threads associated with those processes, if any. The count of threads per process might be sufficient.
Would someone direct me where i might find this information.
Thank You.
You can use the psutil module (download here) for cross-platform process information delivery.
After installing, use the following code to get the thread count of any process id.
import psutil
for proc in psutil.process_iter():
print proc.name+' ['+str(proc.get_num_threads())+' threads]'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With