>>> import os >>> import sys >>> os.path.dirname(sys.executable) 'C:\\Python25'