1

I would like to run a Python script in another Python script. I understand that the best way to do that is importing that script. But I couldn't figure out how I can run that script every 60 seconds. What I have tried so far:

    import time
    import mailyolla

    while(1):
        mailyolla
        time.sleep(60)

and

    import time

    while(1):
        import mailyolla
        time.sleep(60)

Neither worked. What should I do?

1 Answer 1

4

You should define a main() function in your mailyolla file that is executing the task you want. Then, the above script would look like:

import time
import mailyolla

while(True):
    mailyolla.main()
    time.sleep(60)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.