Renaming identifiers & debugging

Chris Rebert clp2 at rebertia.com
Thu Feb 25 13:38:57 EST 2010


On Thu, Feb 25, 2010 at 7:26 AM, Luca <lucat at despammed.com> wrote:
> Hello, i am trying to develop an application to teach programming to young
> kids in a similar way as Logo did in the past. I would like to use an
> embedded Python as underlying language but this raises a problem.
>
> The target of my app are very young kids that might be unfamiliar with
> english, so i am wondering if there is a way to rename/redefine identifiers
> and messages in the language of the kid.
>
> In UCB-Logo this is very easy with the command
>  COPYDEF "newidentifier "oldidentifier
> so all you have to do is setup a startup script to redefine all the
> identifiers to the language of the user.
>
> Is there anything similar for python? Since python would be embedded it
> would not be a problem for me to do it through some API.

It can certainly be done (c.f. ChinesePython -
http://www.chinesepython.org/cgi_bin/cgb.cgi/english/english.html),
but I know of no framework that simplifies the task. Essentially, you
just have to manually modify Python's parser by swapping out the
english for the other language (and if you want to mess with the basic
types' names, their name definitions somewhere else too). There also
might be encoding issues to deal with.

Cheers,
Chris
--
http://blog.rebertia.com



More information about the Python-list mailing list