文件试图保存Python文件:无法保存在python
g = open('~/ccna_pages/'+filename, 'w')
g.write(page)
g.close()
得到这个错误:
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'
但是,目录不会在该位置存在。
此语法似乎是什么Python文档建议.. http://docs.python.org/release/1.5/tut/node46.html
我缺少什么?谢谢..
作为调试方法,尽量只写一个文件没有文件路径,只是一个名称,以确保那不是问题 –
你可能不想阅读Python 1.5文档。 – geoffspear