Printing Python version in output

前端 未结 5 1145
清歌不尽
清歌不尽 2020-11-30 17:07

How can I print the version number of the current Python installation from my script?

5条回答
  •  难免孤独
    2020-11-30 17:34

    import platform
    print(platform.python_version())
    

    This prints something like

    3.7.2

提交回复
热议问题