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

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -