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. Kind regards, Roald