Run while loop concurrently with Flask server
I'm updating some LEDs using python. I've been doing this like so: from LEDs import * myLEDs = LEDs() done = False while not done: myLEDs.iterate() I wanted to use Flask to act as a bridge between some nice-looking ReactJS front-end I can run in my browser (to change the current pattern, etc) and the LED-controlling code in Python. I have Flask working fine, can handle HTTP requests, etc. I'm wondering how I can set myLEDs.iterate() to continuously run (or run on a rapid schedule) concurrently with my flask app, while still being able to communicate with one another, like so: myLEDs = LEDs()