Martin Bless > but how can my script know it its running from inside PythonWin? I don't know if it is all that robust but performing 'dir()' from a PythonWin Interactive Window shows an interesting 'pywin' symbol, so: if 'pywin' in dir(): print 'PythonWin' Seems to work. Neil