[Tutor] i can only write one line of code on python shell helpplease ?

Alan Gauld alan.gauld at btinternet.com
Mon Mar 9 23:17:19 CET 2009

"mustafa akkoc" <mustafa.cmpe at gmail.com> wrote

> - In python shell ,   i can only write one line of code when I go to 
> next
> line this sign appears  >>>  how can write the code like in script 
> mode and
> run

You can't.
Shell mode means you are entering code directly into the interpreter
so it executes the code line by line (or as a block if it is a block, 
like a for loop

If you are using IDLE (or Pyhonwin)  you can open a new window which
will alow you to create a new Python script and run that from within 
And you can keep entering lines in the shell window, the results from
previous lines are stored as they would be in a normal program.

Alan G
Author of the Learn to Program web site

More information about the Tutor mailing list