Has the syntax for Python in VS Code been updated?

I am taking Mosh’s Python course and trying to write my first program in Visual Studio Code. Mosh says to type: HelloWorld $python3 app.py However this is not working. Any suggestions? I am being told that VS Code can’t find the command.

The command to type is python3 app.py on Mac/Linux and python app.py on Windows. “Helloworld” and “$” are part of Mosh’s prompt.

I tried this. It didn’t work.

Please provide a screenshot so we can see what exact command you typed where and what the exact error message is.

Please include a screen capture of the issue.

Thanks

I posted a screenshot. The laptop actually belongs to someone else.

Try to save the file before running it.

1 Like

It has been saved. I opened the file from the desktop.

Look at the file path at the top of the editor, then at the file path you are running it from in the terminal. They are different, no?

1 Like

This worked. For some reason, I have to open the folder HelloWorld from inside VS Code, instead of from the desktop. Then the command works. Thank you.

I found something that works. For some reason, I have to open the folder HelloWorld from inside VS Code, instead of from the desktop. Then the command works. Thanks for your help.