IOError: [Errno 13] Permission denied:

前端 未结 2 1442
有刺的猬
有刺的猬 2021-01-21 01:47

I have built this code to specifically identify a load of .XML files and to extract co-ordinates from those files. Here is my code:

from xml.etree import Element         


        
相关标签:
2条回答
  • 2021-01-21 02:04

    Maybe you just need to write the file path with \ instead of /:

    workspace = "D:\\J040083"
    

    Or, without backslash escaping as a raw string:

    workspace = r"D:\J040083"
    
    0 讨论(0)
  • 2021-01-21 02:11

    You need to change the line

    tree = ET.parse(workspace)
    

    to

    tree = ET.parse(filename)
    

    because workspace is a directory and the parse method takes a filename.

    0 讨论(0)
提交回复
热议问题