title: Filename conventions for Python
body: <p>Why must I add an extra backslash before the file name of "black.txt" but not before "planet.txt"?</p>
  
  <p>What's the difference between "b" and "p"? It would not work for file names starting with other characters either such as "a".</p>
  
  <pre><code> open('C:\Python27\MyScripts\\black.txt')
  </code></pre>
  
  <p>Here's the error I get when I don't use the two backslashes before "black.txt":</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Python27\MyScripts\script5.py", line 2, in &lt;module&gt;
      f = open('C:\Python27\MyScripts\black.txt')
  IOError: [Errno 22] invalid mode ('r') or filename:
  'C:\\Python27\\MyScripts&gt;\x08lack.txt'
  </code></pre>