Gus*_*sto 0 python xml error-handling
处理.xml文件= 1,45 Gb时出现MemoryError.我试图在一个较小的文件上运行它,它的工作原理,所以代码中不应该有任何错误.代码本身意味着打开一个xml文件,在里面做一些东西并将它保存回一个新的txt文件.我运行Win7 x86,2 Gb RAM,Python 2.6
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
openfile('ukwiki-latest-pages-articles.xml')
File "C:\Users\Vof Freeman\Desktop\Python\test.py", line 7, in openfile
contents = F.read()
File "C:\Python26\lib\codecs.py", line 666, in read
return self.reader.read(size)
File "C:\Python26\lib\codecs.py", line 466, in read
newdata = self.stream.read()
MemoryError
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1811 次 |
| 最近记录: |