Renaming identifiers & debugging

Luca lucat at despammed.com
Thu Feb 25 12:42:43 EST 2010


Steven D'Aprano wrote:
> However, you can't rename statements such as for, while, if and similar, 
> nor can you rename error messages. There might be an internationalised 
> version of Python in the language the children speak. Have you tried 
> googling?

Yeah, this is what i am talking about. It seems that keywords (if, 
while, for, etc) cannot be renamed at all. Not easily at least without 
recompiling Python from source. Same thing with error messages.

What i need is not an internationalized version of python in a specific 
language... but a simple way to let the teacher do it by 
himself/herself. Since python will be embedded in my application i could 
also load this via a text-file or XML file... but it seems that no API 
has been made available to solve this problem.

Logo is the only language i know that lets the user do this in a very 
simple way, that's why i brought it as example of what i need. In Logo 
every identifier can be changed with a simple startup file and every 
error message can be personalized by editing a text file. This allows 
any user/parent/teacher to personalize the language for their kids. What 
i need is an API that lets my application do something similar to the 
python library. Unfortunately it seems that there is no easy way to do it.

> Have you tried the Python debugger?
> 
> import pdb


Didn't know it, thank you. Now i need to understand if this PDB module 
can be used from the application that is embedding pythong (so that i 
can build a simple IDE to set breakpoints, show the current 
execution-line, skip it, etc.

Thanx,
   Luca



More information about the Python-list mailing list