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.

guigui dm
  • 25
  • 2

2 Answers2

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

Jasper
  • 1,795
  • 1
  • 12
  • 17
0

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

Mo Ri
  • 1
  • 1