Message376738
Op vrijdag 11 september 2020 17:06:43 CEST schreef u:
> Serhiy Storchaka <storchaka+cpython@gmail.com> added the comment:
>
> It was not clear what you do without code and full traceback.
>
> The example uses *function* parse() from *module* ElementTree. Your code
> seems uses *method* parse() of *class* ElementTree.
>
> https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.Eleme
> ntTree.parse
> https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.Elem
> entTree.ElementTree.parse
I have very little knowledge about class, instance and the other specific
terms used in Python.
I just try to use a Python script, I found and need, and ran into this
problem. What it does looks simple to me. As simple as the 3 line script I
showed, which works.
Why does the larger script give this confusing error about a missing argument,
which is present? It is a file name or file object as it should.
What I understand is that tree becomes an instance. Of what?
Is the problem caused by using ElementTree in "import xml.etree.ElementTree as
ElementTree". Should I use "import xml.etree.ElementTree as ET" and "tree =
ET.parse(f)"?
--
fr.gr.
Freek de Kruijf |
|
Date |
User |
Action |
Args |
2020-09-11 21:09:28 | f.de.kruijf | set | recipients:
+ f.de.kruijf |
2020-09-11 21:09:28 | f.de.kruijf | link | issue41759 messages |
2020-09-11 21:09:28 | f.de.kruijf | create | |
|