Below there is some fully functioning code.
I am planning to execute this code through command line, however I would like it to end after 60 seconds.
Does an
I hope this is an easy way to execute a function periodically and end after 60 seconds:
import time import os i = 0 def executeSomething(): global i print(i) i += 1 time.sleep(1) if i == 10: print('End') os._exit(0) while True: executeSomething()