• 15-10-2019, 16:25:16
    #1
    for bilgi in bilgiler:
        if sayici == 0:
            urun_kodu = bilgi.text[11:]
            root = ET.SubElement(rootcuk,"SHOPITEM")
            ET.SubElement(root, "PRODUCT_ID").text=urun_kodu
            tree = ET.ElementTree(root)
            tree.write("urunler.xml")
    şöyle bir kod bloğum var ama her seferinde üzerine yazıyor ekleme yapmıyor öncekini silip yenisini yazıyor bunu nasıl her seferinde ekleyecek hale getirebilirim
  • 15-10-2019, 17:15:07
    #2
    TheAvenqer adlı üyeden alıntı: mesajı görüntüle
    for bilgi in bilgiler:
        if sayici == 0:
            urun_kodu = bilgi.text[11:]
            root = ET.SubElement(rootcuk,"SHOPITEM")
            ET.SubElement(root, "PRODUCT_ID").text=urun_kodu
            tree = ET.ElementTree(root)
            tree.write("urunler.xml")
    şöyle bir kod bloğum var ama her seferinde üzerine yazıyor ekleme yapmıyor öncekini silip yenisini yazıyor bunu nasıl her seferinde ekleyecek hale getirebilirim
    Nasıl bir ekleme yapmak istiyorsun? Örnek xml atar mısın?
  • 15-10-2019, 17:20:36
    #3
    godlessturtle adlı üyeden alıntı: mesajı görüntüle
    nasıl bir ekleme yapmak istiyorsun? örnek xml atar mısın?
    <shopitem>
    <product_id>1</product_id>
    </shopitem>
    <shopitem>
    <product_id>2</product_id>
    </shopitem>
    <shopitem>
    <product_id>3</product_id>
    </shopitem>
  • 15-10-2019, 17:25:21
    #4
    TheAvenqer adlı üyeden alıntı: mesajı görüntüle
    <shopitem>
    <product_id>1</product_id>
    </shopitem>
    <shopitem>
    <product_id>2</product_id>
    </shopitem>
    <shopitem>
    <product_id>3</product_id>
    </shopitem>
    Full kodu atarmısın hocam düzenleyip vereyim.
  • 15-10-2019, 18:06:55
    #5
    GodLessTurtLe adlı üyeden alıntı: mesajı görüntüle
    Full kodu atarmısın hocam düzenleyip vereyim.
    pm attım hocam