On Tue, 29 Dec 2009 16:09:58 +0100, Roald de Vries wrote: > Dear all, > > Is it possible for a Python script to detect whether it is running > interactively? It can be useful for e.g. defining functions that are > only useful in interactive mode.
Ah, I should have looked more carefully at the docs... http://docs.python.org/library/sys.html#sys.ps1 sys.ps1 and sys.ps2 are documented as only existing if you are running interactively. -- Steven -- http://mail.python.org/mailman/listinfo/python-list