Files
twitterboard/tests/flask_stop.py
2013-02-15 00:32:18 +01:00

30 lines
437 B
Python

import time
from multiprocessing import Process
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return "Hi there!!!"
def run():
app.run()
if __name__ == '__main__':
app.debug = True
print "starting process"
server = Process(target=run)
server.start()
print "sleeping"
time.sleep(5)
print "ending process"
server.terminate()
server.join()
print "bye..."