Page output from inside the python shell (REPL)

published Apr 25, 2013 10:16   by admin ( last modified Apr 25, 2013 10:16 )
import pydoc
pydoc.pager('\n'.join('Hello World %d!' % x for x in xrange(200)))



I had no idea about this. It works well with pythn 2.7 on Ubuntu 12.04

 


Read more: Link - mitsuhiko comments on how to print output like "less" in shell?