title: Use wget from python with Popen
body: <p>I am writing a python (2.7) script that checks if some files are missing and downloads them via wget. Everything works fine, but after the download has finished and the script should exit, the bash (where I started the python script from) is not showing up correctly. 
  I have the cursor and can enter things, but the standard prompt is not showing up. I have to resize the terminal window to make the prompt display correctly. What might be the reason for this? </p>
  
  <pre><code>tilenames = ['File1', 'File2', ...]
  web_url = http://...
  
  for t in tilenames:
      try:
          open(t, 'r')
      except IOError:
          print 'file %s not found.' % (t)
          command = ['wget', '-P', './SRTM/', web_url + t ]
          output = Popen(command, stdout=subprocess.PIPE)
  
  print "Done"
  </code></pre>
  
  <p>I think it has something to do with the way the wget process is invoked. The last command <em>print "Done"</em> is actually done before wget writes all of its output into the shell.</p>