Is there a way to execute python code in a browser, other than using Jython and an applet?
The execution does not have to deal with anything related to graphics. For example, just sum all the digits of a binary 1Gb file (chosen by the browser user) and then return the result to the server.
I am aware that python can be executed remotely outside a browser, but my requirement is to be done inside a browser.
For sure, I take for granted the user will keep the right to execute or not, and will be asked to do so, and all this security stuff... but that is not my question.
You can now (2016) also use:
http://www.transcrypt.org
It compiles Python 3.6 (incl. multiple inheritance, operator overloading, all types of comprehensions, generators & iterators) to lean and fast JS, supports source level debugging with sourcemaps and optional static typechecking using mypy.
Disclaimer: I am the initiator of the project.
Brython - "A Python 3 implementation for client-side web programming"
You mean client-side?
Sure you can! But you need to have python installed on the client first.
The linked book describes that in order to use client-side Active Scripting, you can test it with the a simple
html
file.In the old version refered in that book (Python programming on Win32 By Mark Hammond, Andy Robinson) it says that you need to install the Python Win32 extensions, and it will automatically register Python Active Scripting. Should you do it manually, you have to run the script
python\win32comext\axscript\client\pyscript.py
.No, you can't.
Modern browsers only run javascript or plugins. You can develop your own python plugin and convince people to download and run it, but I guess that falls to the "not inside the browser" category.