[Tutor] Re: New function and 3 line program not working?

SunDragon sundragon at cogeco.ca
Thu Nov 11 10:22:18 CET 2004


I would like to Thank!
Alan Gauld
Liam Clarke

Looking at two responses I recieved and combineing the info, I have solved the problem.

When I first start up the IDLE gui, it is titled "Python Shell" and I was attempting to enter everything here and I kept getting >>> after each line I
typed, and it would not work.  

IDLE 1.0.3      
>>> def newLine():
 print


>>> print "First Line"
First Line
>>> newLine()

>>> print "Second Line"
Second Line

But, I learned that if I open a new window from the "Python Shell" and then enter everything, then save,  it would work
just fine.

It was well described by Alan Gauld.

"Thats correct. The interactive shell is intended for trying thingsout.
For example you can define your function there and play with it to
make sure it works before transferring it into your program
proper - this is how most Python programmers work in practice.
Experiment in the >>> shell then once it works transfer to the
final program in a file."


SunDragon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20041111/6c1ee655/attachment-0001.html


More information about the Tutor mailing list