[IPython-dev] brythonmagic
Kiko
kikocorreoso at gmail.com
Mon Mar 3 17:05:21 EST 2014
2014-03-03 18:13 GMT+01:00 Paul Ivanov <pi at berkeley.edu>:
> Kiko, on 2014-03-03 08:21, wrote:
> > I would like to show you an extension I made:
> >
> > https://github.com/kikocorreoso/brythonmagic
> ...
> > Also, you can have a look to a video I made showing the notebook in
> action
> > in case you don't want to install the extension:
> http://youtu.be/adQzjuUX0kw
>
> This looks great, thanks for sharing. The OpenLayers example in
> particular looks quite fun. Might you consider including Brython
> as a git submodule?
Right now my brython.js is a slight modification of the official brython
release. Right now it is just a proof of concept. If it is interesting (I
think it is) for the IPython community I can PR my modifications to the
official brython repo and then you can use brython.js from a cdn or from
the official brython site (brython.info) so it wouldn't be necessary to
load the js libs locally.
> The Brython Py_VFS.js file contains the
> entire Python standard library, from what I understand.
>
The py_VFS.js doesn't contains the full python stdlib. It contains some js
libs and some python libs. You can take a look here:
libs (js):
https://bitbucket.org/olemis/brython/src/f13e1f0d94637767c4a5f1b399a9e36c5f8ab5ac/src/libs/?at=default
Lib (python):
https://bitbucket.org/olemis/brython/src/f13e1f0d94637767c4a5f1b399a9e36c5f8ab5ac/src/Lib/?at=default
For instance, most of the Python C libs are not ported (for example,
itertools was programmed from scratch in python). Depending your use case,
it wouldn't be necessary to use most of the Brython libs. I think that the
'browser' and 'javascript' modules would be necessary to play with the
document and other js libs and the rest of the libraries are already in
Python so in the IPython notebook environment maybe it is unnecessary to
use them in Brython as you could use them in Python more effectively. So,
depending your use case, py_VFS.js can be created only containing the libs
you need and it could be a very light add-on to brython.js.
In the scripts folder of the official brython repo you can find the
make_VFS.py and the make_dist.py to create your own js files including just
what you need. If someone is interested just let me know and I will try to
help or you can ask in the official brython mail list (
https://groups.google.com/forum/?fromgroups=#!forum/brython).
>
> --
> _
> / \
> A* \^ -
> ,./ _.`\\ / \
> / ,--.S \/ \
> / `"~,_ \ \
> __o ?
> _ \<,_ /:\
> --(_)/-(_)----.../ | \
> --------------.......J
>
Cool!! :-D
Best regards.
Kiko
http://pybonacci.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140303/c2c746e3/attachment.html>
More information about the IPython-dev
mailing list