weixin_39929377的博客文件的读写通常包含以下步骤:文件的打开:open()open或with open会返回文件对象,必须用read或readlines之后才能打印在此我会介绍with open 与open之间的区别。提前剧透with open优于open文件的读入:read()文件的...
weixin_39949584的博客with open(output_filename, "wb") as f:f.write(html_request.content)我用这个方法读写文件时,却报错:IOError: [Errno 2] No such file or directory: './output/http%3A//cup.baidu.com/spider'我一开始很懵逼...