Re: How to determine if IO redirection is occurring with the output from a Python program?

2012-04-17 Thread Edward d'Auvergne
what happens when the ansi escape characters are not supported. Cheers, Edward On 17 April 2012 16:29, pat wrote: > Check os.isatty(fd). It will return True if fd is a terminal-like device. > > On Tue, Apr 17, 2012 at 5:21 PM, Edward d'Auvergne > wrote: >> >> Hi, &g

How to determine if IO redirection is occurring with the output from a Python program?

2012-04-17 Thread Edward d'Auvergne
output is solely to the terminal, and in all other cases (redirection to file via '>', pipes via '|', or more complex redirections) the ascii escape characters are suppressed. Any ideas would be appreciated! Cheers, Edward -- Edward d'Auvergne, PhD Lead develope