I just started the 'official' Python tutorial at https://docs.python.org/3/tutorial/interpreter.html and I have a question.
When describing how to execute python commands from the command line, it says the following:
A second way of starting the interpreter is python -c command [arg] ..., which executes the statement(s) in command, analogous to the shell’s -c option. Since Python statements often contain spaces or other characters that are special to the shell, it is usually advised to quote command in its entirety with single quotes.
Below are two commands that I ran from cmd on Windows 10 Pro using Python 3.8.3. Can anyone help explain why enclosing the command in single quotes doesn't seem to work?
C:\Users\______>py -c "print('Hello World!')"
Hello World!
C:\Users\______>py -c 'print("Hello World!")'
(no output returned)
I know the tutorial is written for Linux users, just trying to understand why it doesn't appear to work for Windows.