Is there a way to retreive the path of the executable that is running the current python script (from within the python script)?
That should do what you want
>>> import sys
>>> sys.executable
'C:\\Python26\\python.exe'
>>> import os
>>> os.path.dirname(sys.executable)
'C:\\Python26'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With