Unable to save file in python
- by some1
Trying to save files in python:
g = open('~/ccna_pages/'+filename, 'w')
g.write(page)
g.close()
Get this error:
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'
However, the directory does exist at that location.
This syntax seems to be the what the python docs recommend.. http://docs.python.org/release/1.5/tut/node46.html
What am I missing? Thanks..