Python 如何使用GUI Tkinter和Pandas在Excel中添加数据
嗨, 我想通过单击“添加”按钮将数据添加到excel工作表中。我正在使用tkinter for GUI和pandas处理excel。我尝试了get()方法从输入字段中获取数据并将其添加到excel工作表中。但我在excel表格中看不到任何东西。请帮忙。我的代码如下 ===========Python 如何使用GUI Tkinter和Pandas在Excel中添加数据,python,pandas,tkinter,project,xlrd,Python,Pandas,Tkinter,Project,Xlrd,嗨, 我想通过单击“添加”按钮将数据添加到excel工作表中。我正在使用tkinter for GUI和pandas处理excel。我尝试了get()方法从输入字段中获取数据并将其添加到excel工作表中。但我在excel表格中看不到任何东西。请帮忙。我的代码如下 =========== 老实说,我在你的代码中没有看到任何与熊猫有远程连接的东西。你到底是如何使用它的?老实说,我在你的代码中甚至没有看到任何与熊猫有远程连接的东西。你到底是如何使用它的? from tkinter import *
老实说,我在你的代码中没有看到任何与熊猫有远程连接的东西。你到底是如何使用它的?老实说,我在你的代码中甚至没有看到任何与熊猫有远程连接的东西。你到底是如何使用它的?
from tkinter import *
import pandas as pd
def UpdateSheet():
writer = pd.ExcelWriter("Match1.xlsx")
var.get(writer)
writer.save()
top2=Tk()
top2.geometry("800x800")
var = StringVar()
t2name = Label(top2, text="Team 2 name").place(x=20, y=30)
t2entry = Entry(top2, width=30,textvariable=var).place(x=100, y=30)
sbtbtn2 = Button(top2, text="Submit", activebackground='Orange', activeforeground='Black',
command=UpdateSheet).place(x=100, y=500)
top2.mainloop()