Detect PythonWin?

Andrew Dalke adalke at
Fri Aug 1 10:59:21 CEST 2003

Martin Bless wants to know how to do:
> if detect("running on PythonWin"):
>     pass
>     # fake arguments ...
> else:
>     "proceed normal"

To see if you're on Windows,

>>> import sys
>>> sys.platform

To see if the win32 extensions are installed

  import win32com  # or another module in the extension
except ImportError:
  print "Not installed"
  print "Installed!"

                    dalke at

More information about the Python-list mailing list