[wingide-users] Detecting when a script is running inside of Wing

Wingware Support support at wingware.com
Wed Mar 28 15:52:44 MDT 2007

Tony Cappellini wrote:
> This has probably been asked before..
> Is there a way to detect when a script is running inside of Wing,
> either using an exception or some sort of global?
> The reason I want to detect this is because Debugging doesn't work
> reliably when a script is processed with psyco, and I want to
> automatically disable this when running inside of Wing.

This should do it:

import os
if not os.environ.get('WINGDB_ACTIVE'):
   import psyco
   # etc


Stephan Deibel
Wingware | Python IDE
Advancing Software Development


More information about the wingide-users mailing list