if __name__ == "__main__":
import tkinter as tk
from tkinter import ttk
window = tk.Tk()
def clear():
for btn in toClear.copy():
btn.destroy()
toClear.remove(btn)
def readFilefunction():
clear()
def enter():
path = ent_Filepath.get()
readFile(path)
#window.geometry("250x75+250+75")
ent_Filepath = tk.Entry(window, width=15).pack()
btn_Enter = tk.Button(window,command=enter,text="Enter").pack()#place(x=30,y=20)
def searchFilefunction():
txt_Model = ttk.Entry(window)
txt_Size = ttk.Entry(window)
print('searchFile')
def addRecordfunction():
print('addRecord')
def modQuantityfunction():
print('modQuantity')
functions = {
"readFile": readFilefunction,
"searchFile": searchFilefunction,
"addRecord": addRecordfunction,
"modQuantity": modQuantityfunction
}
toClear = []
title = tk.Label(text= "Please choose a function")
title.pack()
toClear.append(title)
for text, fu1 in functions.items():
frame = tk.Frame(master=window)
frame.pack(side=tk.LEFT)
button = tk.Button(
master=frame,
text=text,
width=10,
height=2,
command=fu1
)
button.pack()
toClear.append(button)
window.mainloop()
the .get function gets the error
Cannot access member "get" for type "None" Pylance(reportGeneralTypeIssues)[Ln 42, Col 33]
Member "get" is unknown
and i'm not sure why
it was working but i changed something but cant remember what sorry. im not sure how to fix it from here. please dont hesitate to ask for any further details