title: Why do I need 4 backslashes in a Python path?
body: <p>When I'm using Python 3 to launch a program via <code>subprocess.call()</code>, why do I need 4 backslashes in paths?</p>
  
  <p>This is my code:</p>
  
  <pre class="lang-python prettyprint-override"><code>cmd = 'C:\\\\Windows\\\\System32\\\\cmd.exe'
  
  cmd = shlex.split(cmd)
  
  subprocess.call(cmd)
  </code></pre>
  
  <p>When I examine the command line of the launched <code>cmd.exe</code> instance with Task Manager, it shows the path correctly with only one backslash separating each path.</p>
  
  <hr>
  
  <p>Because of this, I need this on Windows to make the paths work:</p>
  
  <pre><code>if platform.platform().startswith('Windows'):
      cmd = cmd.replace(os.sep, os.sep + os.sep)
  </code></pre>
  
  <p>is there a more elegant solution?</p>