Menu Close

How to check what version of Python is running a script?

Sometimes, we want to check what version of Python is running a script.

In this article, we’ll look at how to check what version of Python is running a script.

How to check what version of Python is running a script?

To check what version of Python is running a script, we can use the sys.version property.

For instance, we write

import sys

print(sys.version)

to print the version out by using sys.version.

Conclusion

To check what version of Python is running a script, we can use the sys.version property.

Posted in Python, Python Answers