Jun-01-2020, 07:49 AM
If I`m copying the data from a excel file (as exemple 2x rows and 2x columns, or more) and paste them in a tkinter table interface, everything will be pasted in a single entry. The excel cells wil not be spread in tkinter entries (ex: excel A1, A2, B1, B2 are going in the same entry and the point is to make them go in different entries: A1 cell data to be paste in mouse selected row * col; A2 cell data to be paste in mouse selected row + 1 * col + 1; B1 on row + 2 * col + 1 and B2 on row + 2 * col + 2).
I'm wondering if anyone had the same difficulty and if a solution was found.
An exemple bellow:
I'm wondering if anyone had the same difficulty and if a solution was found.
An exemple bellow:
try: from tkinter import * except ImportError: from Tkinter import * """ import pyperclip a = pyperclip.paste() print(a) space = 0 tabs = 0 newline = 0 first = "" for character in a: if character == " ": space +=1 elif character == '\t': tabs += 1 print(first) elif character == '\n': newline += 1 print(space) print(tabs) print(newline) """ root = Tk() my_entries = [] #list for storing entries height = 10 width = 5 for r in range(10): #numbers of rows for c in range(14): #number of columns my_entry = Entry(root, width=14) my_entry.grid(row=r+2, column=c, pady=1, padx=1, ipady=4) my_entries.append(my_entry) root.mainloop()