python 脚本检测python 版本

资料来源:https://www.cnblogs.com/xudongliang/p/5047862.html

自己整个小函数

def ispy3():
    '''判断当前解释器是否是Python3版本'''
    import sys
    if sys.version_info >= (3, 0):
        return True
    else:
        return None
    
print(ispy3())

  

原文地址:https://www.cnblogs.com/blogs-1024/p/12459056.html