在 2023/4/15 2:33, angela vales 写道:
Hello All,

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
I am not sure how to solve your problem. The newsgroup may not be able to wait for an answer, so I suggest that you go to Stack Overflow to ask questions after conducting a thorough Google search. Of course, you can also wait for someone who knows the answer to come and answer:D
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to