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?

asked Jul 9, 2019 at 10:37

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)
answered Jul 9, 2019 at 10:39
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.