title: Unable to save file in python
body: <p>Trying to save files in python:</p>
  
  <pre><code>g = open('~/ccna_pages/'+filename, 'w')
  g.write(page)
  g.close()
  </code></pre>
  
  <p>Get this error:</p>
  
  <blockquote>
    <p>Traceback (most recent call last):   File "dl-pages.py", line 50, in
    
        g = open('~/ccna_pages/'+filename, 'w') IOError: [Errno 2] No such file or directory: '~/ccna_pages/1.0.1.1.html'</p>
  </blockquote>
  
  <p>However, the directory does exist at that location.</p>
  
  <p>This syntax seems to be the what the python docs recommend..  <a href="http://docs.python.org/release/1.5/tut/node46.html" rel="nofollow">http://docs.python.org/release/1.5/tut/node46.html</a></p>
  
  <p>What am I missing? Thanks..</p>