get python path code example
Example 1: find python path windows
>>> import os
>>> import sys
>>> os.path.dirname(sys.executable)
'C:\\Python25'
Example 2: get pyhton file path python
import os
os.path.realpath(__file__)
>>> import os
>>> import sys
>>> os.path.dirname(sys.executable)
'C:\\Python25'
import os
os.path.realpath(__file__)