![]() |
|
|
|
#1 |
|
Hello,
Does anyone know if the python shell supports paging or if I should look into iPython? Thank you so much. Alex Alex K |
|
|
|
|
#2 |
|
Posts: n/a
|
"Alex K" <> wrote:
> >Does anyone know if the python shell supports paging or if I should >look into iPython? Thank you so much. "Paging" is an overloaded term. What do you mean, exactly? Do you mean something like piping the output into "more"? The Python shell does that for the "help" command, but maybe you could post a more precise example of what you want. -- Tim Roberts, Providenza & Boekelheide, Inc. Tim Roberts |
|
|
|
#3 |
|
Posts: n/a
|
Hi Tim,
Yes I mean piping the output into "more" for example. Alex On 14/01/2008, Tim Roberts <> wrote: > "Alex K" <> wrote: > > > >Does anyone know if the python shell supports paging or if I should > >look into iPython? Thank you so much. > > "Paging" is an overloaded term. What do you mean, exactly? Do you mean > something like piping the output into "more"? The Python shell does that > for the "help" command, but maybe you could post a more precise example of > what you want. > -- > Tim Roberts, > Providenza & Boekelheide, Inc. > -- > http://mail.python.org/mailman/listinfo/python-list > Alex K |
|
|
|
#4 |
|
Posts: n/a
|
On Jan 15, 7:35 am, "Alex K" <spaceout...@gmail.com> wrote:
> Hi Tim, > > Yes I mean piping the output into "more" for example. > Why don't you "suck it and see"??? E.g. C:\junk>copy con demomore.py for i in range(100): print 'line', i ^Z 1 file(s) copied. C:\junk>python demomore.py | more line 0 line 1 line 2 line 3 line 4 [snip] line 50 line 51 line 52 line 53 line 54 line 55 line 56 -- More -- John Machin |
|
|
|
#5 |
|
Posts: n/a
|
Thanks John, but would it be possible to remain in the python interpreter?
On 14/01/2008, John Machin <> wrote: > On Jan 15, 7:35 am, "Alex K" <spaceout...@gmail.com> wrote: > > Hi Tim, > > > > Yes I mean piping the output into "more" for example. > > > > Why don't you "suck it and see"??? > > E.g. > > C:\junk>copy con demomore.py > for i in range(100): > print 'line', i > ^Z > 1 file(s) copied. > > C:\junk>python demomore.py | more > line 0 > line 1 > line 2 > line 3 > line 4 > [snip] > line 50 > line 51 > line 52 > line 53 > line 54 > line 55 > line 56 > -- More -- > > > -- > http://mail.python.org/mailman/listinfo/python-list > Alex K |
|
|
|
#6 |
|
Posts: n/a
|
John Machin <> writes:
> C:\junk>python demomore.py | more Your example uses the OS shell to invoke a pager on the output of the Python process. The OP was asking about paging *within* the Python shell. To my knowledge there's nothing in the default Python shell that enables what the OP is asking for. There are other Python shells, e.g. Idle, ipython, or a Python window inside Emacs, that may be better suited. -- \ "Compulsory unification of opinion achieves only the unanimity | `\ of the graveyard." -- Justice Roberts in 319 U.S. 624 (1943) | _o__) | Ben Finney Ben Finney |
|
|
|
#7 |
|
Posts: n/a
|
Thanks it's good to know. iPyton looks really neat.
On 15/01/2008, Ben Finney <bignose+hates-> wrote: > John Machin <> writes: > > > C:\junk>python demomore.py | more > > Your example uses the OS shell to invoke a pager on the output of the > Python process. The OP was asking about paging *within* the Python > shell. > > To my knowledge there's nothing in the default Python shell that > enables what the OP is asking for. There are other Python shells, e.g. > Idle, ipython, or a Python window inside Emacs, that may be better > suited. > > -- > \ "Compulsory unification of opinion achieves only the unanimity | > `\ of the graveyard." -- Justice Roberts in 319 U.S. 624 (1943) | > _o__) | > Ben Finney > -- > http://mail.python.org/mailman/listinfo/python-list > Alex K |
|
|
|
#8 |
|
Posts: n/a
|
En Mon, 14 Jan 2008 21:05:38 -0200, Ben Finney
<bignose+hates-> escribi�: > To my knowledge there's nothing in the default Python shell that > enables what the OP is asking for. There are other Python shells, e.g. > Idle, ipython, or a Python window inside Emacs, that may be better > suited. Yes, there is. Thanks to Tim Roberts who menctioned that the builtin help system implements paging internally, I looked at it. It's easy to use (but maybe too late for the OP): Let Python determine the best pager available: import pydoc pydoc.pager(text) (it may pipe the text into an external program like less or more). Or explicitely use the builtin pager: import pydoc pydoc.ttypager(text) -- Gabriel Genellina Gabriel Genellina |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| DVD Verdict reviews: GHOST IN THE SHELL: STAND ALONE COMPLEX: 2ND GIG (VOLUME 3) and more! | DVD Verdict | DVD Video | 0 | 03-09-2006 09:22 AM |
| DVD Verdict reviews: GHOST IN THE SHELL: STAND ALONE COMPLEX: 2ND GIG (VOLUME 2) and more! | DVD Verdict | DVD Video | 0 | 01-19-2006 09:34 AM |
| DVD Verdict reviews: GHOST IN THE SHELL: STAND ALONE COMPLEX (VOLUME 4) and more! | DVD Verdict | DVD Video | 0 | 04-21-2005 09:10 AM |
| DVD Verdict reviews: GHOST IN THE SHELL: STAND ALONE COMPLEX (VOLUME 3) and more! | DVD Verdict | DVD Video | 0 | 01-20-2005 10:12 AM |
| DVD Verdict reviews: GHOST IN THE SHELL: STAND ALONE COMPLEX (VOLUME 1) and more! | DVD Verdict | DVD Video | 0 | 08-05-2004 10:03 AM |