Executing python code on a client in a browser


Good day.


When writing a program in the form of a web service, one wants to be able to execute some operations on the Client in the form of python scripts.

The user enters the site, turns on the application. When you click Button1 in the browser, the python script is executed, and Button2 (let's say) sends data to the server.

I want to move the application logic on the client to python, and the interface logic to JS.

There is no bad excuse, that is, the option to ask the user is possible.

Installation of these scripts on the Client is not provided (you just entered, half-scripts along with the Html page and on exit they disappeared). Or through the Google Chrome extension.

PS The Django application sits, but the transition to another is possible.


What solutions are there and are there any?


One of the options – to connect something like Sculpt – allows you to run Python scripts in the browser. To do this, just add the following before </head> :

<script src="http://www.skulpt.org/js/skulpt.min.js" type="text/javascript"></script> 
<script src="http://www.skulpt.org/js/skulpt-stdlib.js" type="text/javascript"></script> 

Skulpt are several alternatives to Skulpt , such as Brython .

Here's an article comparing 6 systems including Skulpt and Brython .

Scroll to Top