Denilson Figueiredo de Sá added the comment:

FYI, "tput" tool can find out the dimensions even when both stdin and stdout 
are redirected. It can't, however, if all stdin, stdout and stderr are 
redirected. Python should probably implement a similar logic.

$ echo | stty size
stty: standard input: Inappropriate ioctl for device
$ echo | tput cols | cat
223
$ echo | tput cols 2>&1 | cat 
80

(tested under Linux)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14841>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to