#๐ beginner question: how do i run a script in idle?
37 messages ยท Page 1 of 1 (latest)
@halcyon orchid
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.
can you show a screenshot of the error when running it in IDLE?
so this is the idle "shell"
it's what you call a REPL, it evaluates each line of code separately
so following the exercise, you should be typing 5
x = 5
x + 1
and see what happens
ok. do i need a terminal or cmd prompt or something?
No, you are meant to write those statements directly into the shell
the exercise wants you to see the difference between REPL and a .py file
i get that
so did you create a .py file?
i did
yup, now you can do Run > Run Module at the top
and the output will appear in the REPL (the other window)
ok cool
you'll probably notice that there is no output
python files won't display output unless you use a print statement
and then the file location
REPL however will evaluate each line and output the result immediately
REPL stands for "Read/Eval/Print/Loop"
very cool, thanks
Np! If that's all for now, you can close this help thread with !close
!close
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.