I coded a small script using pygame (actually not a video game, but a graphical display for simulation results if that matters) but I'm not really satisfied with it's way of waiting for user events (in my case I'm only interested in a few keys on the keyboard).
It uses a:
running = True
while running:
for event in pygame.event.get():
#tests and hypothetical actions
This loops will saturate a CPU core even if the users doesn't do anything, which means useless stress on the CPU, heat, fan noise, maybe lags. Is there a smarter, ie. more economic, way of putting the program in waiting mode for events without using an infinite loop, but still using pygame.