mardi 30 août 2022

Run a function at a random time in Python

I want to be able to be able to run a function at a random time as long as the program is running.

Let's say I have this function:

def sample_func:
    print("Function is running.")

and some other code running. As long as the program is being run, I want this function to run at a random amount of time between 5 to 10 minutes while other code is being run. Is this possible?




Aucun commentaire:

Enregistrer un commentaire