platform.python_version_tuple()的返回值是什么意思

时间:2017-05-26 10:46:48

标签: python platform

有人可以解释一下platform.python_version_tuple()的返回值吗?什么是主要,次要和补丁级别?使用这些有什么意义?

1 个答案:

答案 0 :(得分:1)

与往常一样,阅读documentation会有所帮助。

您甚至可以直接在IDLE中执行此操作:

>>> import platform
>>> help(platform.python_version_tuple)
Help on function python_version_tuple in module platform:

python_version_tuple()
    Returns the Python version as tuple (major, minor, patchlevel)
    of strings.

    Note that unlike the Python sys.version, the returned value
    will always include the patchlevel (it defaults to 0).

>>> platform.python_version_tuple()
('3', '6', '1')

有关软件版本控制的一般信息,wikipedia(几乎总是)是一个很好的起点。