I am trying to determine the python version but when I run the command python -V with a lower case "v" I see I was moved to the python prompt rather than just returning the python version with me. I tried finding the difference between the 2 but couldn't find anything helpful. Please advice as to what is the difference between the two.
12 Answers
From 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.Long story short
python -v: when you executepython -vseveralmoduleswill be loaded in anticipation of the work for which python is to do for you,pythonalone will get you the python prompt but will not show you the loaded modules and their file location, sopythonandpython -vare in a way equivalent but the latter is more verbose as it shows what getsloadedandunloadedonexit. With this you can see what modules are available to you for work in python.python -V: simply just prints the version number and exits with no python prompt.
From 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.Cheers
2