views:

207

answers:

2

I was working with Python with a Linux terminal screen. When I typed:

help(somefunction)

It printed the appropriate output, but then my screen was stuck, and at the bottom of the terminal was "(end)".

How do I get unstuck? Thanks in advance.

+5  A: 

That program uses your pager, which is by default more. You can exit just by pressing q.

Matthew Flaschen
Well that's a bizzare output of Python. Thank you! I really couldn't find the answer by googling.
Unknown
+10  A: 

The standard on GNU (or other Unix-like) systems is to use the environment variable PAGER for the command that should receive output for viewing one screenful ("page") at a time.

Mine is set to:

$ echo $PAGER
less

Yours might be set to more, or a different command, or not set at all in which case a system-wide default command will be used.

It sounds like yours is modelled after the more program. The program is showing you page-by-page output, and in this case telling you you're at the end.

Most of them (basically, any pager more modern than more) allow you to go forward and backward in the output by using the cursor control keys (arrows and PgUp/PgDown), and many other operations besides.

Since you can do all these things wherever you are in the output, the program needs an explicit command from you to know that you're done navigating the output. In all likelihood that command is the keypress q.

For more information on how to drive your pager, e.g. less, read its manpage with the command man less (which, of course, will show pages of output using the pager program :-)

bignose