How to tell when a script is executed by cron ?

Simon Dobner sdobner at scu.edu.au
Wed Feb 5 20:34:47 EST 2003


On Wed, 05 Feb 2003 06:24:02 +0000, Grant Edwards wrote:

> You can also use
> 
>  if os.isatty(sys.stdout.fileno()):
>       # we're running interactively
>  else:
>       # batch mode

Cool.

Is os.isatty somewhere in the docs, and I just can't find it, or is it
covered by this sentence

"This module searches for an operating system dependent built-in module
like mac or posix and exports the same functions and data as found there."
?

ie, know posix first, and access functions via the os module ?

or is there more to the doco [ >>> dir(os) gives me the names of a heap of
functions that arn't mentioned in the doco ]



SD





More information about the Python-list mailing list