…where the blue arrow is the data deleted after to be selected and now it seems to print the options for the function that I used while the red arrow shows that the data in the column is automatically affected (‘a’ is the last letter of a name… it was automatically deleted after deleting the row showed by the blue arrow, leaving only the last letter of it and I can’t understand why it does). Ins_tv = tv.insert("", 0, values=(cogn, nom, nasc)) So, here is the point: from tkinter import * Now, I guess to be quiet next to the solution but it still messing me. I need to return on this topic because I didn’t solved yet… So, how can I get the windows upgraded from the selection deleted in the treeview windows to rewrite the file? when i insert in the tree2 with this tree2.insert ('', tk.END, valuesn) it insert the last content of the List blow no matter what item i select. Tv.insert("", 0, values=(cogn, nom, nasc)) I have this code to select item from tkinter treeview to another tkinter treeview but when i select the item to insert it the id of item selected is inserted rather but not the content of the id. With open('/path/to/file.csv', 'r+') as elenco: With open('/path/to/file.csv', 'w') as elenco: Message="Si vuole confermare l'eliminazione permanente di") I tried a lot of times to rewrite the file without the data that I don’t need but I can’t understand how to get the infos from the treeview after deleting from it. I also tried to put the treeview’s content in the csv.writerow method but I saw that is not possible.įor sure (as always) it would be a very silly thing to do but I can’t approach to this. Items between parenthesis are referred to a csv.reader method that print the results in a tkinter’s treeview with the ’ insert ’ method. ![]() ![]() Scr_el_csv.writerow([canc_info, nome, nascita, ![]() Scr_el_csv = csv.writer(elenco_aggiornato) Values = tuple(tree_em(selezione))Ĭanc_info = tree_lete(selezione) My function rewrite the whole file, erasing everything from it or I also obtained a copy of the whole file but with a repeated line that is not my choice.Īfter the code just posted above, my last attempt was: def elimina(): I tried different combinations but I can’t understand the way to rewrite the file without the line I chose to delete.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |