title: python handle filenames with whitespace in a directory
body: <p>I have a directory with files that have whitespace in their names, I have a python script that loads these files and runs the <code>tail -n1</code> command on them, but since there is a whitespace in the name, it fails. for eg. </p>
  
  <p>I have a dirctory with the following file</p>
  
  <p><code>data from_10_13_2014 09_00_45.json</code></p>
  
  <p>and my script contains the following line <code>line = os.popen("tail -n1 %s" % files).read()</code></p>
  
  <p>as of now I get the following error</p>
  
  <pre><code>tail: cannot open ‘/home/dataserver/Development/Test/data’ for reading: No such file or directory
  tail: cannot open ‘from_10_13_2014’ for reading: No such file or directory
  tail: cannot open ‘09_00_45.json’ for reading: No such file or directory
  </code></pre>
  
  <p>The workaround I have now is replacing whitespace with <code>_</code> is there any way I can do it without renaming the files?</p>