ich habe folgendes Script:
Code: Alles auswählen
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# xml.py
#
import xml.dom.minidom as dom
import xml.etree.ElementTree as etree
tree = etree.parse('/home/guenter/xt310/2013-11-27_12-45-02_4_58.tcx')
root = etree.getroot()
print('root: ',root)
print('root.attrib: ',root.attrib)
print('root[4]: ',root[4])
print('root[4].attrib: ',root[4].attrib)
Code: Alles auswählen
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 1521, in _find_and_load_unlocked
AttributeError: 'module' object has no attribute '__path__'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "xml.py", line 26, in <module>
import xml.dom.minidom as dom
File "/home/guenter/Projekte/python/vhs/xml.py", line 26, in <module>
import xml.dom.minidom as dom
ImportError: No module named 'xml.dom'; xml is not a package
An welcher Schraube muss ich drehen, damit der Import der Module klappt?
Bis dann ...
MfG
Günter