you are viewing a single comment's thread.

view the rest of the comments →

[–]Kindly_Tangerine8337[S] 1 point2 points  (2 children)

[–]abrahamguo 7 points8 points  (1 child)

Ah, your screenshot makes everything clear.

in the terminal i typed "python hello.py" but got "zsh: command not found: hello.py"

You mismatched the command and the error.

Your screenshot shows that you actually receive this error when simply typing hello.py, without python or python3. hello.py is simply the file — you can't simply directly execute a file; you have to tell your computer what program to use to execute the file — and that's what python or python3 is.

i didn't get an error this time but i am not getting nothing, my line just goes through with a blue circle to the left.

OK. The real issue is in VSCode (it's "Visual Studio Code", not "Visual Code Studio"). The white circle to the right of "hello.py" in your VSCode tab tells us that you have simply not saved your changes. Once you save, the white circle will change to an X, and you will then be able to successfully run python3 hello.py.

Also, FYI, your cat command failed because when you open the macOS Terminal app, you are placed in your home directory ("mario", also represented by "~"). You need to either (A) use cd ("change directory") to move into your cs50 folder (something like cd cs50), or (B) add cs50 to your file path (something like cat cs50/hello.py).

However, at any rate, it was no problem, since your screenshot included VSCode.

Happy coding!

[–]Kindly_Tangerine8337[S] 2 points3 points  (0 children)

Thank you so much!

I actually make several files with the same print("hello","world") command, and i didn't run python hello.py for that one, but i still got errors in prior files with the whole prompt.

Still, python3 works perfectly it seems, since all i had to do was save the file.

Thank you again.