Laughably Stupid Python Questions

I’m attempting to follow a Python tutorial using IDLE but can’t even get past the first example.

>>> # This is a comment
... 2+2

What is “…?” It also says I have to “type a blank line” to end a multi-line command. I can’t even get multiple lines. And how do I type a “blank line?”

These questions probably sound idiotic but I’m basically a total newb at scripting and apparently typing as well as I’ve never typed a blank line. That’s like the question “what is the sound of one hand clapping.”

Did you start up the python interpreter before you started typing python commands?

Isn’t that what IDLE is? A Python shell? Doesn’t it pass input to the interpreter?

">>> " is the python command prompt. Try typing “1” in there and then ENTER for the command shell to process it. Then “1+2”. Then “type( [] )”. Then “dir()”. Etc. Go slow and RTFM.

As I said, I was following the first tutorial on the main Python site. I was Reading The Fucking Manual.

I meant, Read the Formidable Manual. :wink:

so, any luck with the command prompt?

Your problem is that you’re in the command-line interpreter, you shouldn’t type in commands that hold on multiple lines here, instead you should create a new file from IDLE (CTRL-N), type in your python script, then execute it (F5)

Thank you, that’s actually useful information. The tutorial doesn’t mention that at all.

I almost never use IDLE, I’m a Linux console guy. But I remember it used to have multi-line editing capabilities on Windows at least… too bad if they dropped it.

Apparently not…

idle definitely supports multi lines, it would be nearly useless if it didn’t. You don;'t have to make a text file, you can do everyhting interactively, in fact, for learning purposes, i think interactive coding is better.

Ignore the … just enter your lines and press enter twice(entering a blank line) to run them in the command line.

I already dumped IDLE and went to Geany (which I use as a general text editor already). Once I figure out how to configure the path, it worked great! Thanks guys! :slight_smile: