-1

I have a python script that runs continuously on a server using a ‘while true’ loop. This script gets started and stopped arbitrarily and can’t be scheduled.

I would like to control it from a flask app - a single page application that just has a button to toggle the script to either start or stop depending on its current status.

I have the flask app, and I have the script, but I can’t figure out how to run the script separately - outside of the flask app.

zrvcat
  • 59
  • 3

1 Answers1

0

In your script, on each iteration, check some flag (database, file) to decide whether or not to execute.

In you app, act upon this flag.

Jérôme
  • 13,328
  • 7
  • 56
  • 106