[Tutor] Interactive programming.

Edwin Boyette edwin_boyette at yahoo.com
Wed Jan 7 18:13:54 CET 2009


--- On Wed, 1/7/09, WM. <wferguson1 at socal.rr.com> wrote:


From: WM. <wferguson1 at socal.rr.com>
Subject: Re: [Tutor] Interactive programming.
To: "A.T.Hofkamp" <a.t.hofkamp at tue.nl>
Cc: tutor at python.org
Date: Wednesday, January 7, 2009, 11:46 AM


IDLE 2.6
>>> i = 1
>>> j = 11
>>> if  j > 1:
    print j
    else:
        
SyntaxError: invalid syntax
>>>

I am getting a little dizzy here.

I know about text editor, code, save, F5.

Many tutorials say that it is funner and faster to test an idea 'interactively', using IDLE.  Nothing is said about fiddling the output.

In the above bit the 'else' is in the wrong place because IDLE or PYTHON terminated the script.

I hate to be a bore here, but if the mechanics of the program are not as they are said to be in the tutorials, how am I to proceed?
_______________________________________________
Tutor maillist  -  Tutor at python.org
http://mail.python.org/mailman/listinfo/tutor
 
 
You could wrapt it all up in a function and then call the function in idle.
 
 
>>> def nudge_nudge():
 i = 5
 j = 7
 if i <= j:
  print "nudge","nudge"
 else:
  print "whatever"

nudge_nudge()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090107/ed160357/attachment.htm>


More information about the Tutor mailing list