Wow, 15 months later and we are at Brython 2.0!
Changes in Brython version 2.0-20140209-164925
The solution is to define the event callback inside Brython code. The button must have an id :
and the Brython code must include the line
from browser import window
window.echo = echo
- - implement sys.implementation with values adapted for Brython
- - allow syntax del (x, y, z)
- - use Dan McDougall's pyminifier to reduce size of py_VFS.js
- - make_dist generates a script brython_dist.js that can be used as a standalone distribution on a centralised server.
- - add drop files demo (by Glenn Linderman) and French Python course (using module slideshow) to the gallery
- - improved version of py_VFS.js by Billy Earney. py_VFS compiles the standard library to make imports faster. Now packs Python source with JSON instead of base64
- - browser : add attributes "window" and "document" as alias of respectively "win" and "doc"
- - add a module browser/slideshow for PowerPoint-like slideshows in Brython, using a custom file format
- - issue #174 : string format character % has wrong precedence
- - issue #175 : Functions should return None by default
- - issue #183 : re.findall() broken
- - issue #198 : operator precedence not defined for << and >>
- - issue #208 : bug with try / else
- - issue #209 : bug in ternary operator
- - function definions must be evaluated only once, upon function definition
- - bug with del a[:]
- - bug with dir() called without arguments
- - bug in map()
- - bug with "func(x=1,)" ; "return +x" ; "func(10*-x)"
- - bug in divmod and round
- - bug in local_storage method keys()
- - add attribute __doc__ to class and instance methods
- - updated with the changes introduced in this version
- - translation in Spanish updated by Kiko Correoso