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 the latest version of Python.
Check Python Version: Script This is especially useful when you have multiple Python versions installed on your computer. To check which Python version is running, you can use either the sys or the platform module. The script will be the same for Windows, macOS, and Linux.
In a Python IDE, just copy and paste in the following code and run it (the version will come up in the output area):
import sys print(sys.version)
python -V
http://docs.python.org/using/cmdline.html#generic-options
--version
may also work (introduced in version 2.5)
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