Hi, Brython (Browser Python) is an implementation of Python 3 in the browser. Its goal is to be able to write client-side programs in Python instead of Javascript, with code inside tags <script type="text/python>...</script>. As opposed to solutions such as Pyjamas or Py2JS, the translation from Python to Javascript is done in the browser, it doesn't require a precompilation by a Python program
Launched late 2012, Brython is attracting a growing community of Python developers. Version 2.0 supports most of the CPython syntax and improves the interaction with Javascript libraries. The complete changelog is detailed below The main entry point is the Brython site at http://www.brython.info, with an online editor and demos Development is hosted by Bitbucket : https://bitbucket.org/olemis/brython/src Join us on the Google group : https://groups.google.com/forum/?fromgroups=#!forum/brython - Pierre Changes in Brython version 2.0-20140209-164925 ============================================== Backwards-incompatible change ============================= For the sake of namespace isolation, by default, the name of functions and classes defined in Brython are no more available in Javascript global namespace. As a consequence, functions can't be called as event callbacks from HTML tags. For instance, if a function echo() is defined in a Brython script, the following inline code : <button onclick="echo()"> will result in a Javascript error such as "name echo is not defined" when the button is clicked The solution is to define the event callback inside Brython code. The button must have an id : <button id="echo"> and the Brython code must include the line doc["echo"].bind("click",echo) Alternatively, to force the name "echo" into the global Javascript namespace, add it as an attribute of the window object : from browser import window window.echo = echo Features ======== - namespace isolation : in previous versions, the names defined in Brython core scripts were included in the global Javascript namespace, raising risks of conflict with names defined in Javascript programs or libraries. In this version, the only names included in the global Javascript namespace are __BRYTHON__ (used internally) and brython(), the function called on page load - 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. Demos ===== - add drop files demo (by Glenn Linderman) and French Python course (using module slideshow) to the gallery Imports ======= - 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 Built-in modules ================ - 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 Bug fixes ========= - 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 #206 : add <noscript> in case Javascript is disabled - 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 Documentation ============= - updated with the changes introduced in this version - add documentation for the built-in module javascript - translation in Spanish updated by Kiko Correoso -- https://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/