Brython - Python in the browser

Stefan Behnel stefan_ml at behnel.de
Fri Dec 21 06:25:01 EST 2012


Pierre Quentel, 20.12.2012 10:42:
> Le jeudi 20 décembre 2012 01:54:44 UTC+1, Ian a écrit :
>> On Wed, Dec 19, 2012 at 5:07 PM, Terry Reedy wrote:
>>>> To create an element, for instance an HTML anchor :
>>>> doc <= A('Python',href="http://www.python.org")
>>>
>>> To me, that is a awful choice and I urge you to change it.

+1

>> +1.  The DOM already has a well-established API. [...]
>>
>> link = document.createElement('a')
>> link.setAttribute("href", "http://www.python.org/")
>> link.appendChild(document.createTextNode('Python'))
>> document.body.appendChild(link)
> 
> We don't have the same point of view. Mine is to offer an alternative to Javascript, with the simplicity and elegance of the Python syntax, for a programer who wants to develop a web application and doesn't know Javascript. Ultimately this means that the whole DOM API would be described without any mention of Javascript, only with the Python API

If that's your intention, then instead of coming up with something totally
new, unpythonic and ugly, why not take the normal Python route and
implement a subset of the ElementTree API?

Stefan





More information about the Python-list mailing list