Hello All,I am not sure how to solve your problem. The newsgroup may not be able
I found this small group in a google search, so not sure if it is still active but giving it a try nonetheless.
I have recently created a tkinter app and need the ability to copy and paste data from tksheet table into an Excel file. I do have a button for export, but it will be beneficial to also allow the user to simply copy,paste.
I have enabled the appropriate bindings but cannot find a solution to also copy the header information during the copy and paste.
My table is generated after a query is run. Here is a small snippet.
df = pd.read_sql_query(query, conn)
results_table.set_sheet_data(df.values.tolist())
results_table.headers(df.columns.tolist())
results_table.enable_bindings(
"drag_select",
"select_all",
"column_drag_and_drop",
"row_drag_and_drop",
"column_select",
"row_select",
"arrowkeys",
"right_click_popup_menu",
"copy",
"paste",
"undo"
)
best
Angela Vales
在 2023/4/15 2:33, angela vales 写道:
I have recently created a tkinter app and need the ability to copy andpaste data from tksheet table into an Excel file.
在 2023/4/15 2:33, angela vales 写道:
I have recently created a tkinter app and need the ability to copy andpaste data from tksheet table into an Excel file.
First thanks for drawing my attention to tksheet. I've long
been desiring a decent table widget in tkinter and was on the
verge of trying to create one of my own. tksheet looks like
it will do all I need.
As to copy/paste I couldn't see any explicit mention but
it does say the underlying data is in a Tk Canvas so it may
be that copy/paste will just work, did you try it? What
happened if you paste into a text editor in the first
instance? And Excel in the second?
If all else fails you can probably write handlers and bind
to Ctrl-C and Ctrl-V to do something yourself that mimics
cut/paste.
I have recently created a tkinter app and need the ability to copy and paste data from tksheet table into an Excel file. I do have a button for export, but it will be beneficial to also allow the user to simply copy,paste.
I have enabled the appropriate bindings but cannot find a solution to also copy the header information during the copy and paste.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 77:45:37 |
Calls: | 6,716 |
Files: | 12,247 |
Messages: | 5,357,739 |