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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -