#python-ro

/

      • PyGirl joined the channel
      • PyGirl
      • ionelmc
        PyGirl: neata, ce nu ii bine acolo? nu inteleg
      • PyGirl
        pai, ce nu e bine in raspuns ?
      • ionelmc
        nu inteleg ce raspuns cauti
      • PyGirl
        in principiu nu am reusit sa gasesc o cale de a face ceea ce se cere acolo. Raspunsul dat de acel user lacks of some info
      • ionelmc
        explica in detaliu ce problema incerci sa rezolvi
      • intrebarea pe SO tu ai pus-o ?
      • PyGirl
        da
      • exact aceea este problema pe care incerc sa o rezolv
      • ionelmc
        ok, ce ai incercat sa faci pana acum?
      • PyGirl
        pai, am incercat ce m-a sfatuit acel user.. insa, nimic concret pana acum. Nu am gasit absolut nimic legat de modificarea structurii unui XML
      • ionelmc
        cum lucrezi? in repl sau ceva editor?
      • PyGirl
        pycharm
      • ionelmc
        iti recomand un repl
      • ruleaza doar python
      • sau instaleaza-ti ipython
      • e mai usor sa incerci chestii asa
      • PyGirl
        pai, lucrez in pycharm de 3 ani deci... mi-e foarte usor si astfel :)
      • ionelmc
        si ce rezultat produce exemplul tau?
      • PyGirl
        imi returneaza trei obiecte de tipul Element <PmtInf>
      • ionelmc: dar apoi, ar trebui sa compar cumva fiecare nod din fiecare pmtinf, sa vad daca difera unul dintre ele, iar daca difera, sa fac remove la tot nodul si sa adaug tagul <cdtr..> la <pmtinf> initial
      • ionelmc
        pai returneaza elementul principal
      • SoulRaven joined the channel
      • SoulRaven has quit
      • PyGirl
        ionelmc: am reusit asta pana acum: https://dpaste.de/aSOe
      • dar nu functioneaza complet
      • ionelmc
        ce nu merge?
      • PyGirl
        teoretic in momentul in care nu indeplineste conditia, ar trebui ca elementul respectiv sa nu fie sters:) in momentul de fata lista mea initiala arata cam asa:
      • [[<Element 'things' at 0x0133B1E0>, <Element 'things' at 0x0133B210>, <Element 'CdtTrfTxInf' at 0x0133B240>], [<Element 'things' at 0x0133B420>, <Element 'things' at 0x0133B450>, <Element 'CdtTrfTxInf' at 0x0133B480>], [<Element 'things' at 0x0133B630>, <Element 'things' at 0x0133B660>, <Element 'CdtTrfTxInf' at 0x0133B690>]]
      • iar rezultatul actual:
      • [[<Element 'things' at 0x0133B1E0>, <Element 'things' at 0x0133B210>, <Element 'CdtTrfTxInf' at 0x0133B240>, <Element 'CdtTrfTxInf' at 0x0133B480>, <Element 'CdtTrfTxInf' at 0x0133B480>]]
      • insa rezultatul ar trebui sa fie:
      • [[<Element 'things' at 0x0165B1E0>, <Element 'things' at 0x0165B210>, <Element 'CdtTrfTxInf' at 0x0165B240>, <Element 'CdtTrfTxInf' at 0x0165B480>], [<Element 'things' at 0x0165B420>, <Element 'things' at 0x0165B450>, <Element 'CdtTrfTxInf' at 0x0165B480>], [<Element 'things' at 0x0165B630>, <Element 'things' at 0x0165B660>, <Element 'CdtTrfTxInf' at 0x0165B690>]]
      • ionelmc
        uita-te la „root”
      • PyGirl
        stai, ultima lista e gresita :)
      • ar trebui sa am o lista de doua liste
      • ce sa vad la root ?
      • ionelmc
        pai uita-te la elementul parinte
      • print ala poti sa vezi tot arborele de elemente
      • variabila aia „nodes„ nu are nici o treaba cu ce vrei tu
      • e doar stocare temporara
      • PyGirl
        pai da, stiu ca e stocare temporara
      • momentan vreau sa imi creez structura dorita
      • apoi fac update la arbore
      • insa structura nu este cea dorita (inca)
      • movlex joined the channel
      • movlex has quit
      • movlex joined the channel
      • movl has quit
      • PyGirl has quit
      • rfv has quit
      • rpappalax has quit
      • rfv joined the channel
      • rpappalax joined the channel
      • rpappalax has quit
      • rpappalax joined the channel
      • rfv joined the channel
      • rpappalax has quit
      • rfv has quit