I have to run a Python script on a Windows server. How can I know which version of Python I have, and does it even really matter? I was thinking of updating to latest version of Python.
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
I have Python 3.7.0 on Windows 10. This is what worked for me in the command prompt and git bash:
To run Python and check version:
To only check which version you have:
or
Note:
python
,python --version
,python -V
,Python
,Python --version
,Python -V
did not work for me. Posted this answer in case others had the same issue.Just create a file ending with .py and paste the code bellow into and run it.
If several Python interpreter versions are installed on a system, run the following commands.
On Linux run in terminal:
On Windows run in command prompt:
For me. open CMD and run py it will show something like Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.
If you have Python installed then the easiest way you can check the version number is by typing "python" in your command prompt. It will show you the version number and if it is running on 32 bit or 64 bit and some other information. For some applications you would want to have a latest version and sometimes not. It depends on what packages you want to install or use.
http://docs.python.org/using/cmdline.html#generic-options
--version
may also work (introduced in version 2.5)When I open
Python (command line)
the first thing it tells me is the version.