0

I would like to know if there is a tool to auto open and close a python script. For example, I would like my python script opens every 12 hours. In my script I have an infite loop. So after 12 hours, I need the script to be closed and reopened. Thank you.

3
  • Which OS are you working on? Commented Nov 21, 2018 at 10:28
  • I am on a google cloud vm, Debian GNU/LINUX Commented Nov 21, 2018 at 10:31
  • You could maybe use the sched python library? Commented Nov 21, 2018 at 10:36

2 Answers 2

0

You can use the watch command to open your script every 12 hours. More information on watch and an example: https://askubuntu.com/questions/430382/repeat-a-command-every-x-interval-of-time-in-terminal.

Closing the script can be done from within your script. More information and an example: Stop code after time period

Sign up to request clarification or add additional context in comments.

Comments

0

One solution could be create main proces with timer and start or close subprocess

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.