How to get the python version number in python

巴扎黑
Release: 2016-12-09 13:50:51
Original
1354 people have browsed it

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()
Copy after login
#!/usr/bin/python
import sys
print sys.version 
print sys.version_info
Copy after login


source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template