Renaming identifiers & debugging

News123 news123 at
Fri Feb 26 00:09:39 CET 2010

Hi Luca,

Luca 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.
a pragmatic approach might be to preprocess the source code
and keep the original version as comments above the translated line.
(for debugging)

or to preprecess the input line before the 'exec'.

It might be, that kids are flexible enough to use English words without
understanding them.

My younger brother could write Pascal before he learnt any English and
he never cared, what 'if' 'then' 'else' 'for', etc. meant.

It might be useful though to internationalize the python errror messages
if that's not something already done.



More information about the Python-list mailing list