What Does the python -v Command Do

后端 未结 2 1948
悲哀的现实
悲哀的现实 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:55

    This will show you the way your modules are loading for debugging reasons. (in this case it is just the base modules)

    Documentation: https://docs.python.org/2/using/cmdline.html#cmdoption-v

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题