Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. import os
  2. import xml.dom.minidom
  3.  
  4. spisok =[]
  5. for root, dirs, files in os.walk("////app2.stop.ru//defaultVars//Vars//Connections"):
  6. for file in files:
  7. if file.endswith(".substvar"):
  8. path = os.path.join(root, file)
  9. spisok.append(path)
  10.  
  11. for element in spisok:
  12.  
  13. doc = xml.dom.minidom.parse(element)
  14. data ={}
  15.  
  16. for info in doc.getElementsByTagName("globalVariable"):
  17. name = str(info.getElementsByTagName("name")[0].firstChild.data)
  18. value = str(info.getElementsByTagName("value")[0].firstChild.data)
  19. data[name]=value
  20. print(element,"n",data,"n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement