我知道您可能已经看过这个标题,但请不要标记为重复,因为我的错误是不同的。我正在制作一个与 openpyxl 进行比较的 excel 程序,并使用 tkinter 使 UI 更加友好。这是我的代码:
import openpyxl
from tkinter import *
from tkinter.filedialog import askopenfilename
from openpyxl.utils import get_column_letter, column_index_from_string
f1 = ''
f2 = ''
sheet1 = ''
sheet2 = ''
root = Tk()
root.configure(background='light green')
root.geometry("500x500")
root.wm_title("BananaCell")
e1 = Text(root, width=15, height=1)
e1.pack()
e1.place(x=70, y=150)
e2 = Text(root, width=15, height=1)
e2.pack()
e2.place(x=300, y=150)
def destroy():
root.destroy()
def get_1():
inputValue = e1.get("1.0", "end-1c")
print(inputValue)
def get_2():
inputValue2 = e2.get("1.0", "end-1c")
print(inputValue2)
bf = Button(root, text="Enter", …Run Code Online (Sandbox Code Playgroud)