command line - Run programmes in a sequence using python -


this question has answer here:

i have python programme below

import os import subprocess m in range(0,10):     os.chdir("c:/")     run="my command%d"%m     subprocess.popen(run).wait()        

where 'my command' used launch programme. although have wait() after popen, turns out 10 programmes still run simultaneously, not expected. how settle issue?

two options:

also, datetime.datetime.now() gives microsecond, can see time granularity higher 1s.


Comments

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

javascript - Which segment of a polyline was clicked? -

c# - Avoiding duplicate methods for Task and Task<T> -