title: How to treat whitespace in bash via Python?
body: <p>I am trying to run the ffmpeg command to record the screen using the <code>subprocess</code> module. Everything is fine with this line:</p>
  
  <pre><code>subprocess.Popen(["ffmpeg", "-video_size", GivenSizeOfScreen, "-framerate", GivenRateOfFrames, "-f", "x11grab", "-i", ":0.0", "-q", GivenQuality, GivenPathAndName])
  </code></pre>
  
  <p><code>GivenPathAndName</code> is something like <code>file:///home/user/Videos/test.mp4</code>. As I said, it's working. (It is in this form because I am getting the folder URI from a GTK widget).</p>
  
  <p>However, the problem is when I select a folder with a white spaces. Like <code>file:///home/user/Documents/New Folder</code>. This will give me the following error in terminal:</p>
  
  <pre><code>file:///home/user/Documents/New%20Folder/test.mp4: No such file or directory
  </code></pre>
  
  <p>I know that this is because of bash misinterpreting the whitespace. And that I can actually run it with putting <code>\</code> before the whitespace to solve it. However, I couldn't manage to find a way to do that from Python sending it to Bash.</p>