Please someone help me.
I just downloaded python like an hour ago and spent the entire hour trying to figure out what I did wrong.
I started learning it today and I am stuck. I don’t know what to do
I tried opening a file using: python hello.py
But it’s not working ‘hello’ I s the name of my file. I saved it under the fileextension .py. I don’t know what is wrong. The only thing in my code is
And it still didn’t work.
I know it’s like dumb and funny but I feel stupid. I can’t even figure out what is wrong
What happened when you ran your hello.py script?
Share the output here as preformatted text useing the </> button.
Once we can see what happened we can help.
The error is because
hello.py is not on the current working directory. This is not really about python, but more about learning to use the terminal.
Solution: Find where you save the file
hello.py. Then, either
python [insert full path to hello.py, e.g. C:\something\hello.py]. Or,
cd [insert path to the directory where hello.py is residing, e.g. C:\something] to change your working directory. Then run
That is probably because your file is not in the same location as your default directory. Make sure you:
- Change your default directory to the location of the file you intend to run.
- You save the file that you intend to run to the location of your default directory.
If you have
IDLE downloaded, you can open the module that you intend to run, and run it without
worrying about the two options.
It will run it without worry or concern of your default directory. By selecting the
Run Module option from the
Options drop-down menu, it will make the directory where the module is located as the active directory.
Don’t put your programs in C:\Windows; this folder is part of the operating system itself.
You can put your programs in, say, a folder in your Documents folder.
On Windows, it’s recommended that you use the Python Launcher
When I start Command Prompt, the initial prompt is
C:\Users\Terry>, which is what is should be. If I enter the
C:\Users\Terry>set, I see
You should see the same thing but with your username. If not, what?
I see it. My user name is just user so I see
Okay, I have removed it. Thank you!
Okay, I will do that thank you! I have visual studio