ragardner / tksheet

Python tkinter table widget for displaying tabular data
https://pypi.org/project/tksheet/
MIT License
408 stars 50 forks source link

trouble with shifting the data over the tksheet #197

Closed janez111 closed 1 year ago

janez111 commented 1 year ago

Dear everyone, i have some troubles using tksheets in tkinter GUI. So with csv writter i write the data from tk.Entries and tksheets into txt file (or csv). when I open it i could lost one row in the sheet. With entries there are no problems, except the entries with higher index than tk sheets, as the sheets are shrinking? in is sort of weird as in the first save everyting is ok in txt or csv script, loading is also ok, but with multiple savings and loading, even without any data manipulation i lose rows. I will not claim that every save cost me a row, so the issue it is not really absolutelly repetable, however at 5 save/load repetitions i definetely lost one row?. Here is part of the code, if it is of any help? def shrani_datoteko():

data = [('Txt Documents(*.txt)', '*.txt')] 
file = asksaveasfilename(filetypes=data, defaultextension=data)
with open(file, 'w', encoding='utf-8', newline='') as f:  
    writer = csv.writer(f, delimiter=';')    
    writer.writerow(['PODATKI ZA PRESKUS'])
    writer.writerow(['Nadmorska višina (m):', h.get()])
    .#code fot the tk.Entries
     #
    writer.writerow(['PREGLEDNICA ODČITKOV ZA REFERENCO'])
    data_ref = preglednica_ref.get_sheet_data(get_header=True, get_index=False, get_rows=False, get_columns=False)

    for row in data_ref:
        writer.writerow(row)     
     ..............................
janez111 commented 1 year ago

Dear sirs, i solved the issue, which in fact was not issue at all. So please consider my issue report as not relevant.

Best regards, janez111