while gui.running:
if gui.get_event() and gui.is_pressed(gui.SPACE):
solar.initialize_particles() # reinitialize when space bar pressed.
elif gui.is_pressed(gui.ESCAPE):
exit(0)
NameError: name ‘exit’ is not defined
why can’t use exit to quit ?
Normally, you could set gui.running = False to break the while loop instead of using exit.
while gui.running:
if gui.get_event() and gui.is_pressed(gui.SPACE):
solar.initialize_particles() # reinitialize when space bar pressed.
elif gui.is_pressed(gui.ESCAPE):
gui.running = False