Freek de Kruijf <f.de.kru...@gmail.com> added the comment:

Op vrijdag 11 september 2020 11:31:29 CEST schreef u:
> Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:
> 
> parse() is an instance method. It should be called as tree.parse(f) (where
> tree is an instance of ElementTree), not ElementTree.parse(f).
> 
> ----------
I have no idea how to make tree an instance.
Reading the documentation,
https://docs.python.org/2/library/xml.etree.elementtree.html,
it shows as an example:

import xml.etree.ElementTree as ET
tree = ET.parse('country_data.xml')

which is exactly what the program looks like and what my small python script 
does without an error.

-- 
fr.gr.

Freek de Kruijf

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41759>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to