Это полный XML-код соединений. xml.
Код: Выделить всё
Код: Выделить всё
def checkfile(filename):
if zipfile.is_zipfile(filename):
zf = zipfile.ZipFile(filename, 'r')
if "xl/connections.xml" in zf.namelist():
print(filename)
xml = zf.read('xl/connections.xml')
root = parseString(xml)
connections = root.getElementsByTagName('connection')
try:
for con in connections:
for child in con.childNodes:
# there are no 'children'
for children in child.childNodes:
dsn = children.attributes.values()[0].nodeValue
sql = children.attributes.values()[1].nodeValue
writeoutput(filename, dsn, sql )
except:
pass
Это то, что я получаю как ошибка:

Я использую Pycharm в качестве IDE.
Спасибо
Подробнее здесь: https://stackoverflow.com/questions/787 ... -in-python