You have called
call
grid
ontheframe = Frame(exam_started).grid()which means
theframe
will be pointing to None
call
grid
on a separate line to have a reference to Frame
theframe = Frame(exam_started) theframe.grid()