Aug-29-2022, 05:57 PM
(Aug-29-2022, 04:58 PM)snippsat Wrote: Can use psutil for this.thank you for the reply, I used that medhod,
Example.
import psutil count = 0 PROCNAME = "python.exe" for proc in psutil.process_iter(): if proc.name() == PROCNAME: count += 1 print(count)
Output:3(Aug-29-2022, 04:29 PM)kucingkembar Wrote: I want to limit it by using a script like this(just an idea)Don't use
while taskmanager.count("Python") > 4: time.sleep(1.0)how do I do this?time.sleep()
when what to schedule at task as certain interval,use eg schedule
Look at my post here,you can rewrite it a little to check that just a limited of prosses is spawned.
I use time.sleep() because I download using for loop, if file do not exist : take a breath 1second ,then download