On Windows, how do I find the path to python.exe from within a script at runtime?
SilentGhost
322k6767 gold badges312312 silver badges294294 bronze badges
asked Dec 4, 2009 at 13:18
shaftoe
Add a comment |
1 Answer 1
>>> import sys >>> sys.executable 'C:\\Program Files\\Python31\\pythonw.exe' answered Dec 4, 2009 at 13:19
SilentGhost
322k6767 gold badges312312 silver badges294294 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
- The Overflow Blog
-
-
- Featured on Meta
-
-
-
Linked
Related
Hot Network Questions
- Is there a talmudic source for reciting part of Hallel on the last six days of Pesach?
- An explanation about Theorem 3.1.4 of Marker’s Model Theory
- Cut-Off Frequency vs. Resonant Frequency in LC Circuits — What’s the Real Difference?
- Launching windows commandline commands within a WSL, what's the story?
- How does that one wire type circuit work?
- What is an Undercover Word™?
- At what speed does a pulse propagate in a conducting wire?
- Do higher damage bows shoot farther?
- Cambridge to Utrecht with less carbon than flying
- Unexpected parenthesis for custom notation
- Rear pressure bulkhead
- Did an Iranian organization use millions of dollars to promote Shia (sect of Islam) in Japan and only a single person converted?
- Are Old Methusalah-type Stars in Faraway Galaxies?
- Bash Backup script for password DB
- Why does the author use "you almost got us killed" vs "you almost killed us"?
- Theology aside, what is the best english rendering of *παρα σεαυτου* in John 17:5
- I'm thinking of quitting my job after a month. How would I explain this to future employers?
- Need help with neumorphism usability
- Short story a watcher who sleeps ten thousand years and wakes to destabilize stagnant civilization if needed 1980s or earlier
- Why can std::string only create a constexpr object if it's a static variable?
- How do we define active symmetries on gauge fields in theories on general manifolds?
- Are my chances ruined for this graduate school?
- Toilet bowl filling up with water
- xcolor not fully colouring commutative diagrams drawn by tikzcd
lang-py