Python Forum

Full Version: Make entire script run again every 45 mo
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Newbie here with limited python knowledge.
I have a script that is dependent on 3 sensors to output gathered info. The original script is from the Petpot project
on Instructables. I can send/post it if necessary.
The script runs. After about 45 min to an hour, it seizes. I think if it were to start again every 45 min, that would no longer be the case.

There is a loop in the scripting:

# Main loop
running = True
clock = pygame.time.Clock()
At the end of the script he has placed:

pygame.display.update()
    clock.tick(30)

# Clean up video capture objects and quit
for cap in emoji_animations.values():
    cap.release()

try:
    pygame.quit()
except pygame.error as e:
    print(f"Pygame error while quitting: {e}")

quit()
I'm sure there is an easy answer to this. I just can't seem to find a solid solution. Thank you in advance.