Python: can not import lxml.etree.xmlfile -
trying use lxml xml file generation.
in api documentation stated class xmlfile exists: http://lxml.de/api/lxml.etree.xmlfile-class.html
i use import:
from lxml import etree but when executing getting error
global name 'xmlfile' not defined" on line: xmlfile(os.path.join(self.path, "filename.xml"), encoding='windows-1251') xf:
python import semantics different seem expect.
from <package> import <name> doesn't make names in <name> available.
you need go through <name>, in case etree.xmlfile.
Comments
Post a Comment