[Baypiggies] Windows python path

Paul M¢Nett p at ulmcnett.com
Wed Mar 12 00:18:52 CET 2008


Hi Jeff,

> If you have a windows machine handy, and you have python installed,  
> could
> you please send me the path to your python interpreter.

By default it seems to go to {sysdrive}/python{version}, or c:\python25.

Try this (untested and probably fragile) function:

def getPythonDir():
   import os
   return os.path.split(os.path.split(os.__file__)[0])[0]

I'm sure someone will chime in with a better way.

Paul


More information about the Baypiggies mailing list