I have a python script that calls another python script. Inside the other python script it spawns some threads.How do I make the calling script wait until the called script is completely done running?
This is my code :
while(len(mProfiles) < num):
print distro + " " + str(len(mProfiles))
mod_scanProfiles.main(distro)
time.sleep(180)
mProfiles = readProfiles(mFile,num,distro)
print "yoyo"
How do I wait until mod_scanProfiles.main() and all threads are completely finished? ( I used time.sleep(180) for now but its not good programming habit)
subprocessmodule. Can you show the code ofmod_scanProfiles.main(distro)?mod_scanProfiles.main()to wait for all threads to finish before returning. Either way shouldn't be too hard.subprocessyou probably just need to doThread.jointo wait.