Detect PythonWin?

Martin Bless m.bless at gmx.de
Fri Aug 1 06:32:06 EDT 2003


[Andrew Dalke]:

>To see if you're on Windows,
[...]
>To see if the win32 extensions are installed

Ok,
but how can my script know it its running from inside PythonWin?

I often have the situation that while developing with PythonWin I have
to  insert code like

if 1 and "developing in PythonWin":
    sys.argv[1:] = ['fake', 'arguments']

Later on or when running the same script from the commandline I need
to disable this if statement. Nasty.

I'm looking for a predicate functions that will let my script know if
it's running from inside PythonWin. And the function shouldn't use
much time or resources if we are not in PythonWin.

Anybody knows?

Martin








More information about the Python-list mailing list