import tkinter as tk
import xlrd
root = tk.Tk()
workbook = xlrd.open_workbook('V:\\Operations & Technology\\Infra\\Customer on Boarding\\MPLS\\IE_SDP_IP_Allocation_MasterFile.xls')
sheet1_object = workbook.sheet_by_index(0)
sheet2_object = workbook.sheet_by_index(1)
button2 = tk.Button(root,text='获取信息',width=10,command=show)\
.grid(row=0,column=2)
tk.mainloop()
import tkinter as tk #导入模块
import xlrd
#创建tkinter窗体
root = tk.Tk()
#读取excel表格内容
workbook = xlrd.open_workbook('V:\\Operations & Technology\\Infra\\Customer on Boarding\\MPLS\\IE_SDP_IP_Allocation_MasterFile.xls')
#根据sheet索引或者名称获取sheet内容
sheet1_object = workbook.sheet_by_index(0)
sheet2_object = workbook.sheet_by_index(1)
#创建按钮
button2 = tk.Button(root,text='获取信息',width=10,command=show)\
.grid(row=0,column=2)
#显示
tk.mainloop()
您好,我是有问必答小助手,您的问题已经有小伙伴解答了,您看下是否解决,可以追评进行沟通哦~
如果有您比较满意的答案 / 帮您提供解决思路的答案,可以点击【采纳】按钮,给回答的小伙伴一些鼓励哦~~
ps:问答VIP仅需29元,即可享受5次/月 有问必答服务,了解详情>>>https://vip.csdn.net/askvip?utm_source=1146287632