title: Getting "IOError: [Errno 2] No such file or directory: 'myoutfile.csv' " error in Python
body: <p>I am using this line to create a new file (the file does not exist):</p>
  
  <pre><code>with open(outfilename, 'rwb') as outfile:
  </code></pre>
  
  <p>And it gets this error:</p>
  
  <pre><code>IOError: [Errno 2] No such file or directory: 'myoutfile.csv'
  </code></pre>
  
  <p>I am trying to create this file, and I thought if I used 'w' that would create it if it doesn't exist. If it is permissions, how do I create a new folder and refer to its path?</p>