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

Dr. Ludger Humbert ludger.humbert at hagen.de
Fri Sep 3 18:55:44 CEST 2004


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.
Perhaps you will better use:
import platform


 >>> print platform.__doc__
  This module tries to retrieve as much platform-identifying data as
     possible. It makes this information available via function APIs.

     If called from the command line, it prints the platform
     information concatenated as single string to stdout. The output
     format is useable as part of a filename.

 >>> platform.system()
'Linux'
 >>> platform.mac_ver()
('', ('', '', ''), '')
 >>>

and may be, when working on a Mac ...


	Ludger


More information about the Pythonmac-SIG mailing list