sys.version和sys.version_info 查看版本

原文链接: https://yq.aliyun.com/articles/418888
>>> sys.version
'3.6.2 (v3.6.2:5fd33b5926, Jul 16 2017, 20:11:06) \n[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]'
>>> sys.version_info
sys.version_info(major=3, minor=6, micro=2, releaselevel='final', serial=0)

>>> if sys.version_info > (3,6):
print('yes')
else:
print('no')

yes

你可能感兴趣的:(sys.version和sys.version_info 查看版本)