In article 234a1a8d-e491-4eec-8bd5-7931cf4f7...@googlegroups.com,
Pierre Quentel pierre.quen...@gmail.com wrote:
Hi,
Ever wanted to use Python instead of Javascript for web client programming ?
Take a look at Brython, an implementation of Python 3 in the browser, with an
interface with
Den fredagen den 27:e december 2013 kl. 07:14:35 UTC+1 skrev Pierre Quentel:
Hi,
Ever wanted to use Python instead of Javascript for web client programming ?
Take a look at Brython, an implementation of Python 3 in the browser, with an
interface with DOM elements and events
Its
On 27.12.2013 07:14, Pierre Quentel wrote:
Hi,
Ever wanted to use Python instead of Javascript for web client programming ?
Take a look at Brython, an implementation of Python 3 in the browser, with an
interface with DOM elements and events
Its use is very simple :
- load the Javascript
Le vendredi 27 décembre 2013 15:56:33 UTC+1, jonas.t...@gmail.com a écrit :
Den fredagen den 27:e december 2013 kl. 07:14:35 UTC+1 skrev Pierre Quentel:
Hi,
Ever wanted to use Python instead of Javascript for web client programming
? Take a look at Brython, an
Le vendredi 27 décembre 2013 17:12:09 UTC+1, Johannes Schneider a écrit :
On 27.12.2013 07:14, Pierre Quentel wrote:
Hi,
Ever wanted to use Python instead of Javascript for web client programming
? Take a look at Brython, an implementation of Python 3 in the browser,
with an
Awesome.. Wonderful work!
--
https://mail.python.org/mailman/listinfo/python-list
Hi,
Ever wanted to use Python instead of Javascript for web client programming ?
Take a look at Brython, an implementation of Python 3 in the browser, with an
interface with DOM elements and events
Its use is very simple :
- load the Javascript library brython.js : script
Oh, and repr is just a synonym of str, which makes it useless.
3 days ago repr was not even implemented at all, so it's a step forward...
--
http://mail.python.org/mailman/listinfo/python-list
I was over-simplifying - or, to put is less diplomatically, I screwed up - when
I answered that the addition returned a string. As Chris pointed out, it made
the explanation very confusing. My apologies
The objects handled by + and = can be :
- strings, integers, floats
- instances of $TagClass
On Sat, Dec 22, 2012 at 6:57 PM, Pierre Quentel
pierre.quen...@gmail.com wrote:
I was over-simplifying - or, to put is less diplomatically, I screwed up -
when I answered that the addition returned a string. As Chris pointed out, it
made the explanation very confusing. My apologies
The
Still, it tends to be a lot harder to explain, document, and read
documentation for, something that uses operators weirdly, rather than
keyword-searchable method names.
You don't explain how to use the Python syntax (for instance the operator %,
which behaves very differently between integers
I forgot to mention : list comprehensions and the ternary operator (r1 if cond
else r2) are now supported !
- Pierre
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, Dec 22, 2012 at 7:54 PM, Pierre Quentel
pierre.quen...@gmail.com wrote:
Still, it tends to be a lot harder to explain, document, and read
documentation for, something that uses operators weirdly, rather than
keyword-searchable method names.
You don't explain how to use the Python
On Sat, 22 Dec 2012 20:08:25 +1100, Chris Angelico wrote:
I don't see string % tuple as a good syntax; I prefer to spell it
sprintf(format,arg,arg,arg).
Very possibly one of the worst names ever from a language that excels at
bad names. Sprint f? WTF?
Certainly not appropriate for Python,
On Sat, Dec 22, 2012 at 10:05 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
On Sat, 22 Dec 2012 20:08:25 +1100, Chris Angelico wrote:
I don't see string % tuple as a good syntax; I prefer to spell it
sprintf(format,arg,arg,arg).
Very possibly one of the worst names ever
On Sat, 22 Dec 2012 23:11:00 +1100, Chris Angelico wrote:
This is a string / 3 == [This , is a , strin, g]
and This is a string // 3 == [This , is a , strin]
then This is a string % 3 == [g] or possibly g
which is incompatible with current usage. But that's a meaning that
makes reasonable
On Sat, Dec 22, 2012 at 1:31 PM, Dan Sommers d...@tombstonezero.net wrote:
So why are we all so comfortable with using * as the operator for
multiplication? I'm sure that a new programming language that dared to
use U+00D7 or U+2715 for multiplication would be instantly rejected on
the
On Sun, Dec 23, 2012 at 7:31 AM, Dan Sommers d...@tombstonezero.net wrote:
On Sat, 22 Dec 2012 23:11:00 +1100, Chris Angelico wrote:
This is a string / 3 == [This , is a , strin, g]
and This is a string // 3 == [This , is a , strin]
then This is a string % 3 == [g] or possibly g
which is
On 12/20/2012 04:37 AM, Pierre Quentel 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.
'=' is not just an operator, it is a comparison operator. It normally
return False or
On 12/21/2012 3:31 AM, Rouslan Korneychuk wrote:
Although I'm not really in favor of using an operator for this sort of
thing either way, I can't help but notice the discussion seems to be
limited to Python's operators. If you're implementing Python yourself,
can't you define a new operator
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
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
Because the tree implementation in ElementTree or other tree modules in Python
require a lot of
On Fri, Dec 21, 2012 at 11:38 PM, Pierre Quentel
pierre.quen...@gmail.com wrote:
With the tree syntax proposed in Brython it would just be
doc = DIV('hello '+B('world'))
If pythonic means concise and readable, which one is more pythonic ?
Pythonic also means:
If the implementation is hard to
Pierre Quentel pierre.quen...@gmail.com wrote:
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
Because the tree implementation in ElementTree or
Duncan Booth, 21.12.2012 14:14:
Pierre Quentel wrote:
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?
Because the tree implementation in ElementTree or
Pythonic also means:
If the implementation is hard to explain, it's a bad idea.
What, exactly, does the sum of a string and a bolded string produce? Can you
explain that easily and clearly?
Yes : a+b returns the string a+str(b)
It is exactly what you get in CPython with
class B:
...
On Sat, Dec 22, 2012 at 2:36 AM, Pierre Quentel
pierre.quen...@gmail.com wrote:
doc.add(Tag('DIV').add('hello ').add(Tag('B').add('world')))
No, with this syntax, the result of Tag('B').add('world') is below 'hello' in
the tree structure, not at the same level (just below Tag('DIV')) as it
= is a comparison expression operator, which is completely different.
It is just wrong for this usage. I am 99.9% sure you will come to regret
it eventually. Better to make the change now than in Brython2 or Brython3.
I am 99.99% sure of the contrary, having used this syntax for more than 3
Hmm. So when that gets added into a DIV, it has to get parsed for
tags? How does this work? This seems very odd. I would have expected
it to remain as DOM objects.
In DIV(child) :
- if child is a string, integer or float, a text node is added (addChild) to
the DIV element, with the string
Pierre Quentel, 21.12.2012 17:16:
So when you see a line like
doc = DIV('hello')
it should be obvious that you are not *comparing* doc and DIV('hello'),
because if it was the case, the line would do nothing
Yep, that's one of the main concerns - it looks like useless code, which is
On Fri, Dec 21, 2012 at 9:16 AM, Pierre Quentel
pierre.quen...@gmail.com wrote:
= is a comparison expression operator, which is completely different.
It is just wrong for this usage. I am 99.9% sure you will come to regret
it eventually. Better to make the change now than in Brython2 or
The interpreter, though, will be more than happy to treat that as a
comparison if the LHS is not the type that you think it is. For
example, maybe you've added it to a string at some point, and now it's
a string instead of an element. I guess that since doc is made a
keyword, that probably
On Fri, Dec 21, 2012 at 1:59 PM, Pierre Quentel
pierre.quen...@gmail.com wrote:
By the way, what is Brython actually doing when you append a child to
the document itself like that? Usually I would expect a div to be
appended to the body or to another div. The above looks like it would
attach
On Sat, Dec 22, 2012 at 3:36 AM, Pierre Quentel
pierre.quen...@gmail.com wrote:
Hmm. So when that gets added into a DIV, it has to get parsed for
tags? How does this work? This seems very odd. I would have expected
it to remain as DOM objects.
In DIV(child) :
- if child is a string, integer
On Fri, Dec 21, 2012 at 3:52 PM, Chris Angelico ros...@gmail.com wrote:
On Sat, Dec 22, 2012 at 3:36 AM, Pierre Quentel
pierre.quen...@gmail.com wrote:
Hmm. So when that gets added into a DIV, it has to get parsed for
tags? How does this work? This seems very odd. I would have expected
it to
Héllo,
doc = 'blah blah xy: '+B('True!')
I will surely backlog latter or some crytologist from the futur will do and
he will surely agree about the fact something strange happened around
december 2012.
Sorry for that, that's me trying to be funny. Last time I checked DOM
manipulation is not
On Fri, Dec 21, 2012 at 4:45 PM, Ian Kelly ian.g.ke...@gmail.com wrote:
In Brython, the str builtin does not return strings?
Oh, and repr is just a synonym of str, which makes it useless.
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Dec 21, 2012 at 4:45 PM, Ian Kelly ian.g.ke...@gmail.com wrote:
In my playing around with it just now, the addition doesn't seem to
actually return a string.
From the code, it appears that adding two nodes together *actually*
returns a $AbstractTag object, which seems to be just a
On Sat, Dec 22, 2012 at 10:57 AM, Ian Kelly ian.g.ke...@gmail.com wrote:
From the code, it appears that adding two nodes together *actually*
returns a $AbstractTag object, which seems to be just a container for
a list of child nodes with no parent, that automagically gets removed
from the
On Sat, Dec 22, 2012 at 10:50 AM, Amirouche Boubekki
amirouche.boube...@gmail.com wrote:
Last time I checked DOM
manipulation is not the primary way for js devs to do DOM manipulation
anymore, or is it ? Javascript template engines do DOM manipulation but this
is almost invisible for the
On Fri, 21 Dec 2012 12:25:01 +0100, Stefan Behnel wrote:
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?
Yo mean something old, unpythonic and ugly? :-P
Le jeudi 20 décembre 2012 01:07:15 UTC+1, Terry Reedy a écrit :
On 12/19/2012 1:19 PM, Pierre Quentel wrote:
The objective of Brython is to replace Javascript by Python as the
scripting language for web browsers, making it usable on all
terminals including smartphones, tablets,
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 tjre...@udel.edu wrote:
That says that my browser, Firefox 17, does not support HTML5. Golly gee. I
don't think any browser support5 all of that moving target, and Gecko
apparently
On Thu, Dec 20, 2012 at 8:37 PM, Pierre Quentel
pierre.quen...@gmail.com wrote:
I'm afraid I am going to disagree. The document is a tree structure, and
today Python doesn't have a syntax for easily manipulating trees. To add a
child to a node, using an operator instead of a function call
* Ian Kelly ian.g.ke...@gmail.com [2012-12-19 17:54:44 -0700]:
On Wed, Dec 19, 2012 at 5:07 PM, Terry Reedy tjre...@udel.edu wrote:
That says that my browser, Firefox 17, does not support HTML5. Golly gee. I
don't think any browser support5 all of that moving target, and Gecko
apparently
On Thu, Dec 20, 2012 at 8:37 PM, Pierre Quentel
pierre.quen...@gmail.com wrote:
I'm afraid I am going to disagree. The document is a tree
structure, and today Python doesn't have a syntax for easily
manipulating trees.
What Python does have is 11 versions of the augmented assignment
On Thu, 20 Dec 2012 18:59:39 -0500, Terry Reedy wrote:
On Thu, Dec 20, 2012 at 8:37 PM, Pierre Quentel
pierre.quen...@gmail.com wrote:
I'm afraid I am going to disagree. The document is a tree structure,
and today Python doesn't have a syntax for easily manipulating trees.
What Python does
On Fri, Dec 21, 2012 at 1:05 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
On Thu, 20 Dec 2012 18:59:39 -0500, Terry Reedy wrote:
What Python does have is 11 versions of the augmented assignment
statement: +=, -=, *=, /=, //=, %=, **=, =, =, =, ^=, |=. Moreover,
these are
Hi,
The objective of Brython is to replace Javascript by Python as the scripting
language for web browsers, making it usable on all terminals including
smartphones, tablets, connected TVs, etc. Please forgive the lack of ambition
;-)
The best introduction is to visit the Brython site
Hi Pierre
this looks very interesting, thanks. But I wonder ... do you know of pyjs
(pyjamas as-was)? http://pyjs.org/
I would be interested in a comparison between (the aims of) Brython and pyjs.
Either way, thanks for the info.
Regards
Jon N
--
On 12/19/2012 1:19 PM, Pierre Quentel wrote:
The objective of Brython is to replace Javascript by Python as the
scripting language for web browsers, making it usable on all
terminals including smartphones, tablets, connected TVs, etc. Please
forgive the lack of ambition ;-)
This sounds
On Wed, Dec 19, 2012 at 5:07 PM, Terry Reedy tjre...@udel.edu wrote:
That says that my browser, Firefox 17, does not support HTML5. Golly gee. I
don't think any browser support5 all of that moving target, and Gecko
apparently supports about as large a subset as most.
On 12/19/2012 7:54 PM, Ian Kelly wrote:
On Wed, Dec 19, 2012 at 5:07 PM, Terry Reedy tjre...@udel.edu wrote:
That says that my browser, Firefox 17, does not support HTML5. Golly gee. I
don't think any browser support5 all of that moving target, and Gecko
apparently supports about as large a
53 matches
Mail list logo