sys.version和sys.version_info 查看版本

2022-09-02 19:30:22 浏览数 (1)

代码语言:javascript复制
>>> 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

0 人点赞