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

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -

jdbc - Not able to establish database connection in eclipse -