I'm working on a program that needs the user to input data. This code that I wrote does not work or it says None in the console. It should print the user input. I know that I might have to use the .get() function but I don't know where. Any help would be great
def settings():
Settings = Toplevel(root)
Settings.title("ad.lo exporter Settings")
Settings.geometry("295x132")
global Pname
Label(Settings, text="Publisher name (abbreviation)").grid(row=0, column=0)
Pname = Entry(Settings).grid(row=0, column=1)
global UNitemailinp
Label(Settings, text="Ad-Unit email address").grid(row=1, column=0)
UNitemailinp = Entry(Settings).grid(row=1, column=1)
global UNitpasswordinp
Label(Settings, text="Ad-Unit password").grid(row=2, column=0)
UNitpasswordinp = Entry(Settings).grid(row=2, column=1)
global UNitsiteinp
Label(Settings, text="Ad-Unit website").grid(row=3, column=0)
UNitsiteinp = Entry(Settings).grid(row=3, column=1)
addrecordBTN = Button(Settings, text="Add record", command=addrecord).grid(row=4, column=0)
removerecordBTN = Button(Settings, text="Remove record", command=removerecord).grid(row=4, column=1)
def addrecord():
print("added record")
print(Pname)#not printing the record