I have 2 .py files below (Both shortened and include the problem sections):
engine.py
engine.py
import events
running = False;
def start():
boot() #Can be safely ignored all it does is call pygame.init()
running = True;
while running:
events.update_events()
if events.exit_request is not None:
running = False
#Logic here
shutdown()events.pyimport pygame
exit_request = None
def update_events():
for event in pygame.event.get():
if(event.type == pygame.QUIT):
exit_request = eventWhile I am using pygame, that isn't where the problem lies, I have tested it and the problem is that if I access the exit_request variable in the events file from engine.py, it will always show up as None even if there is an exit event, but if I print exit_request from inside events.py, it will show up appropriately as pygame_exit_blah blah blah if the user clicked the x button, but like I said will show up as "None" if printed from engine.py. Does anyone know why this is happening?
