I've imported tkinter.messagebox, and my program runs smoothly when I F5 and test it on IDLE.
However my program doesn't run on console when a messagebox should be displayed, and I get the error:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Program Files\lib\tkinter\__init__.py", line 1456, in __call__
File "U:\my documents\6th form\A2\Computing\F454\Code and Prototyping\trackeve
nts.py", line 204, in validation
messagebox.showerror("Data invalid", "The data you have entered is invalid.
Please make sure you have submitted it correctly.")
NameError: global name 'messagebox' is not defined
elif completedValidation == False:
messagebox.showerror("Data invalid", "The data you have entered is invalid. Please make sure you have submitted it correctly.")
import tkinter.messagebox, you have to refer to it as such: with
tkinter.messagebox. If you want to alias it to just
messagebox, you need
from tkinter import messagebox.