K
K
kAIST2011-03-14 15:39:23
Python
kAIST, 2011-03-14 15:39:23

Subprocess doesn't want to wait for wget?

I am writing a python script to download a decent list of files. The script is cunning, so it's not possible to simply feed the list of files to wget.
I launch via:

p = subprocess.Popen(cmd.split(),shell=True)
p.wait()

this respectively occurs in a loop, but does not want to wait until wget downloads the file, accordingly there are many parallel downloads. How to be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
bekbulatov, 2011-03-14
@bekbulatov

Use
subprocess.call(cmd.split(),shell=True)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question