Home  >  Article  >  Backend Development  >  How to get the python version number in python

How to get the python version number in python

巴扎黑
巴扎黑Original
2016-12-09 13:50:511346browse

Recently I have been thinking about how to use python for automated testing, but there has been no progress. I feel that ruby ​​is used more in domestic automated testing. One thing I want to do now is how to use python to test web programs, including web page inspection. Unit testing is a very important concept in large enterprise architecture. This concept is very popular in back-end code, but it is not very common to do unit testing in front-end JS. I wonder if python can be useful in this place. Currently, you can use python to do it. Do interface testing. Today, a classmate asked me how to get the version number of python in python. He would process it according to different versions. Here is the relevant code

#!/usr/bin/python
import platform
print platform.python_version()
#!/usr/bin/python
import sys
print sys.version 
print sys.version_info


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn