David LeBlanc writes: > "isatty" is not documented at all under the Global Modules "sys" entry for > Python 2.2.1 documentation (sorry, I thought "PythonDoc" was a recognized > name). The following doesn't work: ... > Is isatty a built-in, a function of os only available on Unix, or a function > of sys available on all platforms? It appears to be a function in the sys > module and so the doc for it should go there? isatty() is a method of a file object. It's documented as part of the file object; see section 2.2.8 of the library reference manual. > Under the "os" entry it's: > "isatty(fd) > Return 1 if the file descriptor fd is open and connected to a tty(-like) > device, else 0. Availability: Unix. " > > I don't see how to create a file() that is connected to stdout without > importing sys...? Is there a way? If there is not, than file.isatty() is > moot. Standard output is the file object sys.stdout. > So, really, what is the meaning of "64" as the return from > sys.stdout.isatty()? It's a true value. That's all. -Fred -- Fred L. Drake, Jr. <fdrake at acm.org> PythonLabs at Zope Corporation
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4