Hi im trying to build a notification app with python and Tkinter, i want to access the text of a Label from my function with .get() but it seems not to work.
from tkinter import *
from tkinter import messagebox
import time
from plyer import notification
gui = Tk()
gui.geometry('500x500')
gui.title('Notifier App')
def createNotification():
if titleEntry != '' and messageText != '' and whenToDisplayEntry != '':
get_title = titleEntry.get()
get_message = messageText.get()
get_time = int(float(whenToDisplayEntry.get()))
messagebox.showinfo('Notification', 'Successfully created a notification!')
time.sleep(get_time * 60)
notification.notify(title=get_title, message=get_message, timeoout=10)
else:
messagebox.showerror('Error', 'Must fill all fields.')
bigLogo = Label(gui, text = 'Make a notification', font = ('Arial', 30)).place(x = 150,y = 1)
title = Label(gui,text='Title of notification:',font=('Arial', 15)).place(x=1,y=100)
titleEntry = Entry(gui, width='20',font=('Arial', 15)).place(x=170,y=100)
message = Label(gui,text='Message:',font=('Arial', 15)).place(x=1,y=150)
messageText = Text(gui, width='20',height='7',font=('Arial', 15)).place(x=95,y=150)
whenToDisplay = Label(gui,text='When to display(in minutes):', font=('Arial', 15)).place(x=1,y=350)
whenToDisplayEntry = Entry(gui, width='10',font=('Arial', 15)).place(x=255,y=350)
createButton = Button(gui,text='Create a notification!',command=createNotification).place(x=180,y=450)
gui.mainloop()