What should Python apps do when asked to show help?

Rustom Mody rustompmody at gmail.com
Fri Apr 29 01:00:23 EDT 2016


On Friday, April 29, 2016 at 7:45:35 AM UTC+5:30, Paul Rubin wrote:
> Steven D'Aprano  writes:
> > (1) print the help text to stdout;
> > (2) run the help text through a pager;
> 
> Stdout unless the PAGER env var is set.  Otherwise, I'd say still stdout
> since the person can pipe it through a pager if they want, but you could
> use the pager or be fancy and try to detect if stdout is a pty/tty
> before using the pager.  Git pages by default and it bugs me because I
> tend to use git commands in emacs shell windows and the pager makes a
> mess.

Quite bewildered by this thread...
Are we in 2016?
[Reminds me of the bizarre claim that world has not moved on from text]
eg I am on on Ubuntu 16.4 (vanilla) right now.
This means that when I pull up a terminal I get gnome-terminal.
Which means that when the screen fills up I get a scroll bar
Now I can get perverse and use xterm/rxvt.
Or a console outside of X (ctrl-Alt-F[1-6] )
And even there Shift-pgup works

Of course there is the 1 in 100 times this does not hold;
- ssh to a remote machine
- Upgraded ubuntu and broke X 
- etc

[What happens in windows on a cmd-box... not sure]

IOW pager functionality is quite builtin in shells nowadays
Why replicate and cause annoyance?



More information about the Python-list mailing list