def ReadXml():
xmldoc=minidom.parse("D:\Downloads\1.xml")
print xmldoc.toxml()
if __name__ == "__main__":
ReadXml()
--------------------------------------------------------------------------
there throw an error:
Traceback (most recent call last):
File "D:/Downloads/test", line 8, in <module>
ReadXml()
File "D:/Downloads/test", line 4, in ReadXml
xmldoc=minidom.parse("D:\Downloads\1.xml")
File "D:\Program Files\Python25\lib\xml\dom\minidom.py", line 1913, in parse
return expatbuilder.parse(file)
File "D:\Program Files\Python25\lib\xml\dom\expatbuilder.py", line 922, in parse
fp = open(file, 'rb')
IOError: [Errno 2] No such file or directory: 'D:\\Downloads\x01.xml'
------------------------------------------------------------------------------------------
See the red line.the file path"D:\Downloads\1.xml" auto changed 'D:\\Downloads\x01.xml'
I think may be the version cause the problem (version2.4) at the beginning,but when i changed the version2.5 ,
the error still exist.and the code run on another PC is OK.Why this error happen?how could i fix that?
-- http://mail.python.org/mailman/listinfo/python-list