Run a script repeatedly and externally from Flask
you could create a second e.g. python script that would wait for a signal from the web server. With your server, after a user clicked a button, you could write to a file, that the python script periodically checks. Then, after writing "1" into the file, the script would do what you want, e.g. read sensor data every minute.
So you would run your web server and the python script alongside it. The script would be waiting for changes in the dedicated "signal" file. Then after the signal the script would do whatever you wanted.
Imagine you are measuring the distance of something with a Raspberry Pi. You have a nice python script which measures the distance via a sensor and returns a variable.
Imagine you would like to automate the process and view the results on a web page created with Flask. Basically, be able to turn it on and have it run once a minute regardless of whatever else you do in that web page or anywhere else on the "website".
Graphically:
click a button on a web page -> Script starts -> Script runs once a minute, regardless of whether you close the page, navigate to another page, etc.
How would you go about it? 
Consider that the script can run forever if necessary, kind of a fire and forget thing