I'm a beginner to python programming. I want to print what text written in label when I click add button I tried I got the error was displayed
totall = tot.cget("text") AttributeError: 'NoneType' object has no attribute 'cget'
from tkinter import *
from tkinter import ttk
root = Tk()
root.title("Inventory System using Python")
root.geometry("1000x500")
def show():
totall = tot.cget("text")
print(totall)
tot = Label(root, text="sss",font="arial 22 bold").place(x=650, y=10)
Button(root, text="Add",command = show,height=3, width= 13).place(x=650, y=50)
root.mainloop()