#🔒 vsc python [zsh problem]

32 messages · Page 1 of 1 (latest)

worn hawk
#

hiiiii, can anyone tell me what to do here? i'm trying to run 1+2 on the terminal (i'm following a tutorial) but it keeps telling me zsh: command not found. (btw, i just covered my name in the screenshot) thank youuu!!!

timid jayBOT
#

@worn hawk

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

tall bloom
#

You're trying to do python on the zsh command prompt

worn hawk
#

how can i not do it on the zsh command prompt? i'm sorry i'm super new to this

tall bloom
#

There are two windows there. The top one is for typing code and the bottom one is for interacting with your system. you can type python script.py to run your code from there

#

There's probably a VS Code button to do it as well.

lean forge
#

there is, assuming you have the python extension installed

tall bloom
#

@worn hawk Try pressing that play button in the upper right corner

worn hawk
#

i have it installed

lean forge
worn hawk
#

the print("hello world") is working

#

but when i try to run 1+2 on the terminal, it says zsh command not found

tall bloom
#

because you're in zsh there, not Python

#

From that console window you can navigate around your filesystem. If you wanted to open a Python interpreter there you could by just typing python and hitting enter.

#

You'd need to exit out of the Python interpreter before doing anything outside of Python if you did that.

worn hawk
#

oh is the select interpreter thingy? i already did that but it didn't change anything, but if i type python3 on the terminal and run 1+2, it works, is it a valid fix to that

lean forge
#

python has an interactive mode called the REPL where you can evaluate python code in the terminal

#

typing python or python3 on its own enters the REPL

#

that's why it's working

#

there's nothing to "fix" really

worn hawk
#

ooooh okioki

#

but how can i run 1+2 without typing python3

#

is that possible

lean forge
#

do you want to run it from a file, or in the REPL?

worn hawk
#

i don't get what that means i'm sorry T_T, but i want to type 1+2 on the terminal like in the tutorial (needed in class) and get 3, whatever that's called

#

should there be a python choice here?

lean forge
#

in that case you would need to enter the repl by typing python

lean forge
#

they're for interacting with your operating system

worn hawk
#

oh okioki tyyyy

timid jayBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.