while True:
    out = child.stderr.read(1)
if out == '' and child.poll() != None:
    break
if out != '':
    output += out
if time.time() > killtime:
    child.kill()
raise RuntimeError('Child process still going %i seconds after launch' %
    killtime)
updateSQL = "update `videos_graduatevideo` set thumbnail = '" + str(destination
    ) + "' where `original_video` = '" + sourceVideo + "'"
cursor.execute(updateSQL)
How to you check the status or kill an external process with python