What's the right approach for calling functions after a flask app is run?
I'm a little confused about how to do something that I thought would be quite simple. I have a simple app written using Flask . It looks something like this: from flask import Flask app = Flask(__name__) def _run_on_start(a_string): print "doing something important with %s" % a_string @app.route('/') def root(): return 'hello world' if __name__ == "__main__": if len(sys.argv) < 2: raise Exception("Must provide domain for application execution.") else: DOM = sys.argv[1] _run_on_start("%s" % DOM) app.run(debug=True) What I'm finding is that my terminal is outputting the print statements in _run