How to exit when viewing python help like help(os.listdir)

Question:

when the help window pops up, what are the basic commands (mac os) to page up/down, end of document and exiting the help screen?

I just had to close my terminal as I couldn’t figure it out!

Asked By: Blankman

||

Answers:

You are probably in less (this is configurable through the PAGER environment variable, but you probably haven’t changed that). Press h for help and q to quit.

Answered By: Greg Hewgill

Other options to exit the help screen would be to type any one of the following(as described in the help section)
q,:q,Q,:Q and ZZ
.These can be seen when you press ‘h’ once you are on the help screen

Answered By: Tanuj Kaza

In addition to what @Tanuj mentioned, you might need press enter to exit the help prompt after typing the above commands. Unlike how you exit a manual in linux by simply typing q

Answered By: Raghuraj Nair
Categories: questions Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.