[Pythonmac-SIG] Distinguishing between MacPython and Fink Python at runtime

Bob Ippolito bob at redivi.com
Sun Sep 5 16:19:23 CEST 2004


On Sep 3, 2004, at 6:45 AM, hinsen at cnrs-orleans.fr wrote:

> Is anyone aware of a reliable method for finding out at runtime if a 
> program is running under MacPython or the Fink installation of Python? 
> sys.platform is "darwin" in both cases.

Fink should probably test positive with sys.prefix.startswith('/sw')

> The reason for wanting to distinguish between the two is the 
> difference in the handling of modifier keys in the standard X11 Tk and 
> the TclTkAqua that MacPython uses. The X11 version uses Ctrl and Alt 
> (which is mapped to the command key), whereas TclTkAqua uses Ctrl and 
> Command.

However... testing for Fink vs. MacPython is the Wrong Thing To Do.  
You should just try and detect TclTkAqua versus X11 TclTkAqua, not Fink 
vs MacPython.  It's possible to use TclTkAqua with a Fink Python or X11 
Tk with MacPython.  I'm not familiar enough with Tcl/Tk to know how, 
though.

-bob



More information about the Pythonmac-SIG mailing list