"没有这样的文件或目录:"在解析XML时

时间:2015-11-04 10:20:19

标签: python

我有一个解析xml的代码,如下所示

if(args.xml):
    filestring = global_defs.getDrive() + args.xml
    myFile=open(filestring)
    retval=ParseXml(myFile)
    myFile.close()
    print retval 

我正在为我的xml文件提供正确的路径。它似乎没有认识到它。

C:\app\Tools\exam\Python25>python tu_parser.py -xml \users\z234941\t\template_imagetool.xml
Traceback (most recent call last):
  File "tu_parser.py", line 104, in <module>
    myFile=open(filestring)
IOError: [Errno 2] No such file or directory: 'C:\\users\\z234941\\t\\template_imagetool.xml'

任何人都知道我哪里错了?

1 个答案:

答案 0 :(得分:1)

你应该尝试:

C:\app\Tools\exam\Python25>python tu_parser.py -xml "C:\\users\z234941\t\template_imagetool.xml"
相关问题