[Python-Dev] Translate Python language
M.-A. Lemburg
mal at egenix.com
Wed Nov 11 14:55:23 EST 2015
On 11.11.2015 17:20, Donald Stufft wrote:
> On November 11, 2015 at 11:19:07 AM, Paul Moore (p.f.moore at gmail.com) wrote:
>> On 11 November 2015 at 15:13, Christophe Bal wrote:
>>> Hello.
>>>
>>> I'm a french teacher and I would like to use Python with young child but
>>> I've a big problem. All the keyword are in english. So I would like to know
>>> if there is a way to hack the AST tools such as to use french keywords and
>>> then translate a list of french keywords to their english regular version.
>>>
>>> Where should I start ? My idea is not to build a new language but simply
>>> translate words using an hacked version of the AST tools.
>>>
>>> Hoping to be clear and I do not pollute the message in this list.
>>
>> Do you really just mean keywords? Most of the English words used in
>> Python (for example "open") aren't actually keywords but are names of
>> functions defined in the builtins and/or standard library. Those are
>> not exposed as distinct objects in the AST, but are simply name
>> lookups.
>>
>
> You might be able to use an encoding to do this.
Or use Andrew Dalke's fun project LOLPython as basis:
http://www.dalkescientific.com/writings/diary/archive/2007/06/01/lolpython.html
It uses a parser which then translates the source code
into regular Python source code, which it then runs.
--
Marc-Andre Lemburg
eGenix.com
Professional Python Services directly from the Experts (#1, Nov 11 2015)
>>> Python Projects, Coaching and Consulting ... http://www.egenix.com/
>>> Python Database Interfaces ... http://products.egenix.com/
>>> Plone/Zope Database Interfaces ... http://zope.egenix.com/
________________________________________________________________________
2015-10-23: Released mxODBC Connect 2.1.5 ... http://egenix.com/go85
::: We implement business ideas - efficiently in both time and costs :::
eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
Registered at Amtsgericht Duesseldorf: HRB 46611
http://www.egenix.com/company/contact/
http://www.malemburg.com/
More information about the Python-Dev
mailing list