@app.route('/links/<int:n>/<int:offset>')
def link_page(n, offset):
 n = min(max(1, n), 200)
 link = "<a href='{0}'>{1}</a> "
 html = ['<html><head><title>Links</title></head><body>']
 for i in xrange(n):
  if (i == offset):
   html.append('{0} '.format(i))
  else:
   html.append(link.format(url_for('link_page', n=n, offset=i), i))
 html.append('</body></html>')
 return ''.join(html)

@ app . route ( '/links/<int:n>/<int:offset>' ) def link_page ( n , offset ) : n = min ( max ( 1 , n ) , 200 ) link = "<a href='{0}'>{1}</a> " html = [ '<html><head><title>Links</title></head><body>' ] for i in xrange ( n ) : if ( i == offset ) : html . append ( '{0} ' . format ( i ) ) else : html . append ( link . format ( url_for ( 'link_page' , n = n , offset = i ) , i ) ) html . append ( '</body></html>' ) return '' . join ( html )
generate a page containing n links to other pages which do the same .