On 14Nov2014 13:52, Ben Finney <ben+pyt...@benfinney.id.au> wrote:
satishmlm...@gmail.com writes:
How to get file descriptor number for the following:
sys.stdin
sys.stdout
sys.stderr

Why do you need this? What are you intending to do?

In fairness, who cares? It is a basic and reasonable thing to do. I did it only last night: I wanted to know if stderr was a tty or pipe, versus a regular file, as I wanted to special case some error formatting (loosely speaking, default automatic people-friendliness versus log file verbosity).

I know that why people want to do things is important, as they may be choosing the wrong approach. But the above question seems very simple and very basic: he seems unable to get the OS file descriptor number from the standard streams, and this is surprising.

I think he even started the thead with almost a transcript of the failure, and backed off the the above abstraction when someone complained.

Cheers,
Cameron Simpson <c...@zip.com.au>

| Alain van der Heide                      |  This is the way the world ends  |
| a...@dazixco.ingr.com                    |  This is the way the world ends  |
| "The opinions expressed above are mine-  |  This is the way the world ends  |
| mineminemine, and you can't have them."  |  Not with a bang, but with a whi

segmentation fault
core dumped
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to