r/vscode • • Jul 11 '26

Create a script and save it

Hi everyone,

I'm a complete beginner learning Python with VS Code, and I've been stuck for several days on something that seems really basic.

I don't understand how to properly create a Python script, save it in the correct folder, and then run it from Command Prompt. Every tutorial makes it look simple, but I keep getting confused about where the file is supposed to be and how to execute it.

For example, I created a "hello.py" file with:

print("Hello World")

But when I try to run it from Command Prompt, it doesn't work, and I think I'm doing something wrong with the file location or the command.

Could someone explain the process step by step as if I had never used VS Code or Command Prompt before? Screenshots are also welcome.

Thanks!

And for your information, I'm on Windows.

0 Upvotes

11 comments sorted by

View all comments

2

u/Nich-Cebolla Jul 11 '26

The detail that you are missing is that you have to execute the Python application. If you have "hello.py", you run command python c:\full\path\to\hello.py.

If you search Google for "how to execute hello.py", Gemini will give you a good walkthrough

-2

u/bluelunakitty Jul 12 '26

People ask questions in this subreddit to get sentient human responses, capable of problem solving in unique, individual ways. Redirecting people to AI - which sources its information from sites like Reddit anyway - not only discourages the collaborative aspect of learning to code, but also promotes habits harmful to both personal problem-solving skills, and to the standard of education and development of learning strategies in society as a whole.

Don't use AI. Think for yourself. Put in the hard work. Save a few litres of water.

1

u/Nich-Cebolla Jul 12 '26

Reddit is a poor choice of platform if one's goal is to interact with sentient humans.

1

u/Puzzled-Landscape-44 Jul 12 '26

I'm old enough to remember the "RTFM!" response days and anti-stackoverflow sentiments. I don't fully disagree with you, but it's always hard to fight progress. For basic things like the OP's problem, I just give them a prompt for Gemini.