What Does the python -v Command Do

后端 未结 2 1952
悲哀的现实
悲哀的现实 2020-12-19 01:37

I recently reinstalled my macOS and I wanted to check the version of Python. I typed python -v into the terminal and I am not sure what this did? I am new to th

2条回答
  •  暖寄归人
    2020-12-19 01:56

    You didn't do anything wrong. From the man page for Python (accessed by man python):

       -v     Print  a  message each time a module is initialized, showing the
              place (filename or built-in module) from  which  it  is  loaded.
              When  given twice, print a message for each file that is checked
              for when searching for a module.  Also provides  information  on
              module cleanup at exit.
    
       -V ,  --version
              Prints  the  Python  version number of the executable and exits.
              When given twice, print more information about the build.
    

    Think of the lowercase -v as "verbose"—it's useful for debugging modules. The modules you listed are all from the standard library.

提交回复
热议问题