This works in Linux & Windows:
Python 3.x
>>> import sys
>>> print(sys.executable)
C:\path\to\python.exe
Python 2.x
>>> import sys
>>> print sys.executable
/usr/bin/python
More Related Contents:
- how to check if the number is in the list [duplicate]
- How can i insert a multiple listed variable in a while loop?
- How make a complete gui softwaree in a single windows in tkinter
- Why is the output of my function printing out “None”?
- How do I read CSV data into a record array in NumPy?
- list.reverse does not return list?
- Why am I getting “IndentationError: expected an indented block”? [duplicate]
- Pandas Groupby Range of Values
- Does Django scale? [closed]
- What is the cause of the Bad Request Error when submitting form in Flask application?
- Python/Json:Expecting property name enclosed in double quotes
- Convert datetime to Unix timestamp and convert it back in python
- Drop rows containing empty cells from a pandas DataFrame
- DestroyWindow does not close window on Mac using Python and OpenCV
- Pyplot: vertical gradient fill under curve?
- How to efficiently use MySQLDB SScursor?
- WebDriverException: Message: Service /content/chromedriver unexpectedly exited. Status code was: -6 with ChromeDriver Google Colab and Selenium
- “import datetime” v.s. “from datetime import datetime”
- Preventing PyQt to silence exceptions occurring in slots
- Handle an exception thrown in a generator
- How can I access environment variables in Python?
- Checking fuzzy/approximate substring existing in a longer string, in Python?
- Is there a Python equivalent to Java’s AWT Robot class? [closed]
- Can I run a Python script as a service?
- How can I check the memory usage of objects in iPython?
- Modbus Error: [Invalid Message] Incomplete message received, expected at least 2 bytes (0 received)
- networkx DiGraph Attribute Error self._succ
- How to change variables fed into a for loop in list form
- Digitizing an analog signal
- “BadZipFile: File is not a zip file” – Error popped up all of a sudden