I\'ve written a Python script that downloads and converts many images, using wget and then ImageMagick via chainedsubprocess
calls:
for img in
See Using module 'subprocess' with timeout
Not sure if this is the proper
way of doing it, but this is how I accomplish this:
import subprocess
from threading import Thread
def call_subprocess(cmd):
proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = proc.communicate()
if err:
print err
thread = Thread(target=call_subprocess, args=[cmd])
thread.start()
thread.join() # waits for completion.