brython

What is the basic difference between Brython and PyScript?

What is the basic difference between Brython and PyScript? Question: I was trying to understand the difference between PyScript and Brython. So I read the following post: PyScript vs. Brython — What’s the Difference? and didn’t understand anything apart from the following line: Brython converts Python code into native JavaScript, while PyScript is native Python …

Total answers: 2

Brython: import the bs4 library and the requests library

Brython: import the bs4 library and the requests library Question: I am creating a web application using python with the brython.js library and for my application I need to import the bs4 library and the requests library but I don’t know how. Any idea? <script type="text/python"> from browser import document import bs4 #doesn’t work import …

Total answers: 2

How can I see output from a Brython script on the page? Why doesn't `print` work?

How can I see output from a Brython script on the page? Why doesn't `print` work? Question: I try to use Brython. I have a Python script (test.py) and I would like to display the result of this script in the browser. I have tried : <html> <head> <script src=”brython.js”></script> </head> <body onload=”brython()”> <script type=”text/python” …

Total answers: 2

How can I create a websocket JSObject in brython?

How can I create a websocket JSObject in brython? Question: I’m trying to use Brython to run Python code in the browser, and to use websockets in that Python code. I have working JavaScript code that can connect to the Websocket echo server at http://www.websocket.org/echo.html. According to the documentation, the function JSObject can be used …

Total answers: 1

Best way to integrate Python and JavaScript?

How can I integrate Python and JavaScript? Question: Is it possible to integrate Python and JavaScript? For example, imagine you wanted to be able to define classes in JavaScript and use them from Python (or vice versa). If so, what’s the best way? I’m interested not only if this is possible but if anyone has …

Total answers: 13