The output of --version itself is a little too brief:
C:\>python --version
Python 2.7.5
However, if I run Python from the command prompt, I get something similar to the following, with verbose version info for the interpreter all on one line:
C:\> python
Python 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Is there a simple way, in a one-line command or via some options to get that same verbose version info line as a string that I could use to populate an environment variable or such?
In effect, is there a more verbose variant of --version I'm unaware of?
python -c "import sys;print(sys.version)"
is the basics; or to get closer to the same thing:
python -c "import sys;print('Python '+sys.version.replace('\n','')+' on '+sys.platform)"
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