How do I check what version of Python is running my script?

前端 未结 22 2342
醉话见心
醉话见心 2020-11-22 04:11

How can I check what version of the Python Interpreter is interpreting my script?

22条回答
  •  忘了有多久
    2020-11-22 04:38

    Use platform's python_version from the stdlib:

    >>> from platform import python_version
    >>> print(python_version())
    2.7.8
    

提交回复
热议问题