On 02/09/12 23:14, Ray Jones wrote:
could run silently in the background. But is there a way for a Python
(2.7.3) script to determine whether it was called by the user or called
by something like cron or kalarm? That way user inputs could be used
when called by a user, but defaults could be used if run by a bot.

Yes you can query the user via the os module.(getuid or getlogin for example)

Or is this more of a Linux question?

The details are likely to be implementation dependant, differing even between local hosts since it depends on how the admin has set up the user for cron etc

hth
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to