On Tue, Jun 25, 2013 at 2:31 PM, Joshua Landau
<joshua.landau...@gmail.com> wrote:
> On 25 June 2013 21:22, Bryan Britten <britten.br...@gmail.com> wrote:
>> Ah, I always forget to mention my OS on these forums. I'm running Windows.
>
> Supposedly, Windows has "more"
> [http://superuser.com/questions/426226/less-or-more-in-windows],
>
> For Linux+less; this works:
>
> from subprocess import Popen, PIPE
> less = Popen("less", stdin=PIPE)
> less.stdin.write(b"\n".join("This is line number
> {}".format(i).encode("UTF-8") for i in range(1000)))
> less.wait()


Or simply:

$ python my_script.py | less

It works the same way in Windows:

C:\> python my_script.py | more
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to