Skip to content

Instantly share code, notes, and snippets.

@paradoxxxzero
Created March 14, 2018 10:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paradoxxxzero/4d587a21889b3f83bd8cd991ab581fdb to your computer and use it in GitHub Desktop.
Save paradoxxxzero/4d587a21889b3f83bd8cd991ab581fdb to your computer and use it in GitHub Desktop.
from time import sleep
from flask import Flask, Response
app = Flask(__name__)
@app.route("/")
def hello():
def gen(*args):
for i in range(1000):
yield f'I am {i}'
sleep(.02)
yield 'Done'
return Response(gen())
app.run()
# curl -N http://localhost:5000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment