I\'d like for a script of mine to have 2 behaviours, one when started as a scheduled task, and another if started manually. How could I test for interactiveness?
EDI
I'd just add a command line switch when you're calling it with cron:
python yourscript.py -scheduled
then in your program
import sys if "-scheduled" in sys.argv: #--non-interactive code-- else: #--interactive code--