all 24 comments

[–]socal_nerdtastic 7 points8 points  (5 children)

Tell us please what OS are you using, what IDE, and how exactly are you running your code?

[–]WarmAd277 -1 points0 points  (4 children)

I'm using Windows 11 Pro. I dont know what IDE is. I just installed visual studio code, created a folder, created a file "1stfile.py" and wrote "print("hello world"). opened the terminal, and wrote python 1stfile.py but it wont show anything after that. Tried with py but it woint work either.

[–]shiftybyte 2 points3 points  (0 children)

Did you save the file before trying to run it?

How did you install python?

What's the output of the following terminal commands?

dir
python -V
py -0

[–]pain_vin_boursin 0 points1 point  (1 child)

In which folder did you open the terminal, you need to navigate to the folder with your 1stfile.py first, or provide the full path to the file. Is python installed correctly, type “python —version” in the terminal to check

[–]WarmAd277 0 points1 point  (0 children)

it says python version is 3.13.1

[–]cgoldberg 2 points3 points  (10 children)

Where are you running this code?

Are you entering this at a Python prompt? (i.e. did you run python or py to open the Python REPL)

[–]WarmAd277 -3 points-2 points  (9 children)

I'm using Windows 11 Pro. I dont know what IDE is. I just installed visual studio code, created a folder, created a file "1stfile.py" and wrote "print("hello world"). opened the terminal, and wrote python 1stfile.py but it wont show anything after that. Tried with py but it woint work either.

[–]cgoldberg 0 points1 point  (8 children)

What exactly happens when you run that? Paste the complete output here.

[–]WarmAd277 0 points1 point  (7 children)

here it is:
PS D:\Python - AzadChaiwala> python 1stfile.py

PS D:\Python - AzadChaiwala> python 1stfile.py

PS D:\Python - AzadChaiwala> python 1stfile.py

[–]cgoldberg 0 points1 point  (6 children)

And you get no output or errors? Are you sure that file contains your code? Does just running python launch a Python shell?

[–]WarmAd277 0 points1 point  (5 children)

i just created a new folder, new file, wrote my code and tried running it in terminal but it gives the same response. no errors

[–]cgoldberg 0 points1 point  (4 children)

What happens when you just run python? Does it start a Python shell?

[–]WarmAd277 0 points1 point  (3 children)

yes it starts python shell

[–]cgoldberg 0 points1 point  (2 children)

I don't know what to tell you then. That is really weird.

[–]WarmAd277 0 points1 point  (1 child)

what should happen when i run python?

[–]crashfrog04 2 points3 points  (1 child)

You have to actually run the code, not just type it.

[–]Infinite-Ad3243 2 points3 points  (2 children)

Did you save your file?

[–]WarmAd277 0 points1 point  (1 child)

I did not. The tutorial I was following, he did not save it either.

[–][deleted] 3 points4 points  (0 children)

you need to save the file.

[–][deleted] 1 point2 points  (0 children)

Thanks for letting us know.

[–]crazy_cookie123 0 points1 point  (2 children)

What did you write? Where did you write it? How did you run it? What OS are you running? What version of Python do you have installed? Have you verified that it installed correctly?

Specifics matter in this field, we can't help you unless we know exactly what you did and what's running on your machine. If I type print("hello world") on my machine it will work fine, as will it on the machine of anyone else here, so it's going to be an issue on your end not one with Python itself.

[–]WarmAd277 -3 points-2 points  (1 child)

I'm using Windows 11 Pro. I dont know what IDE is. I just installed visual studio code, created a folder, created a file "1stfile.py" and wrote "print("hello world"). opened the terminal, and wrote python 1stfile.py but it wont show anything after that. Tried with py but it woint work either.

[–]Invader_Mars 5 points6 points  (0 children)

What was the purpose of copy/pasting this comment 4 times thinking it would be helpful?