[Edu-sig] interactive vs compiled from file

kirby urner kirby.urner at gmail.com
Sat Aug 4 01:38:37 CEST 2007


On 8/3/07, Andre Roberge <andre.roberge at gmail.com> wrote:

> Kirby got a good point - however, I think that you'd still get the "hook"
> with newbies without the automatic echoing that Michael describes.
>

Not sure we should call this "echoing" as what's happening
is an expression is being evaluated.

It just so happens that the eval of a quoted string returns
itself  whereas "some expression with %s" % "substitution"
would actually evaluate to non-echo.

kirby at dell:~$ python ./repl.py
>>> 'THIS IS A STRING'
THIS IS A STRING
>>> [x*x for x in range(10)]
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
>>> "1-2-3 %s" % "testing"
1-2-3 testing

Would one turn off all of the above, or just the first eval-print?

What would be the point of a broken shell, vs explaining that
Python, like many languages, features a REPL (read-eval-print loop)?

Kirby


More information about the Edu-sig mailing list