Új hozzászólás Aktív témák

  • Atomantiii

    őstag

    válasz Hege1234 #4221 üzenetére

    Abban tudnál még segíteni, hogy ezt hogy tudom átírni, hogy ne a tárhelyről, hanem a saját gépemről töltse be a forrás xml-t és oda is mentse le?

    Próbáltam, de nem igazán akar összejönni, mindig hibát ír erre a sorra:
    edited_tv_programs = ET.tostring(root, encoding='unicode')

    Traceback (most recent call last):
    File "d:\EPG\xmlremove.py", line 24, in <module>
    edited_tv_programs = ET.tostring(root, encoding='unicode')
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Python312\Lib\xml\etree\ElementTree.py", line 1083, in tostring
    ElementTree(element).write(stream, encoding,
    File "C:\Python312\Lib\xml\etree\ElementTree.py", line 728, in write
    serialize(write, self._root, qnames, namespaces,
    File "C:\Python312\Lib\xml\etree\ElementTree.py", line 851, in _serialize_xml
    tag = elem.tag
    ^^^^^^^^
    AttributeError: 'ElementTree' object has no attribute 'tag'

    [ Szerkesztve ]

Új hozzászólás Aktív témák