brython

While loop makes the browser freeze with Brython

馋奶兔 提交于 2020-03-21 06:56:33
问题 I’m trying to get the response of an api request made with ajax.ajax() and the response is stored into ['apiResponse'] in the HTML5 Local Storage (but the rest of the python function processes without waiting for it be put into localStorage). Because of this I need to wait for it before getting the response and I thought I could do what I did below for the program to wait before it proceed. Unfortunately the browser seems to freeze every time I put a while loop... If someone know how to make

While loop makes the browser freeze with Brython

谁说胖子不能爱 提交于 2020-03-21 06:56:11
问题 I’m trying to get the response of an api request made with ajax.ajax() and the response is stored into ['apiResponse'] in the HTML5 Local Storage (but the rest of the python function processes without waiting for it be put into localStorage). Because of this I need to wait for it before getting the response and I thought I could do what I did below for the program to wait before it proceed. Unfortunately the browser seems to freeze every time I put a while loop... If someone know how to make

Best way to integrate Python and JavaScript?

微笑、不失礼 提交于 2019-12-17 05:37:55
问题 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 done it within a "serious" project or product . I'm guessing it would be possible using Jython and Rhino, for one example, but I'm curious whether or not anyone's ever actually done this, and if there are solutions for other platforms

Best way to integrate Python and JavaScript?

让人想犯罪 __ 提交于 2019-12-17 05:37:15
问题 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 done it within a "serious" project or product . I'm guessing it would be possible using Jython and Rhino, for one example, but I'm curious whether or not anyone's ever actually done this, and if there are solutions for other platforms

How to work with OpenCV python library using brython

只谈情不闲聊 提交于 2019-12-10 10:13:12
问题 I have a fully functional Python project which have been tested directly through the terminal. But when I searched on how to integrate Python code with a JavaScript wrapper, I found few of the open-source API's http://www.brython.info/ http://www.skulpt.org/ http://pypyjs.org/ http://transcrypt.org/ http://stromberg.dnsalias.org/~strombrg/pybrowser/python-browser.html I have used brython & was able to run few basic python codes But my python project contain some import statements of libraries

Is it possible to run native python code in chrome?

倾然丶 夕夏残阳落幕 提交于 2019-12-04 19:16:11
问题 I was wondering if it is possible to run native python code in chrome instead of javascript. I have seen projects like pyjs or brython, but what they do is compile python to javascript. While those are great projects a problem with this approach is always that you cannot easily debug the original python code. Amongst other things I stumbled upon this thread, describing how to develop custom code for chromes-sandbox. But this would probably lead to implementing a python interpreter in the

Is Brython entirely client-side?

拥有回忆 提交于 2019-12-03 08:50:55
问题 I have a piece of code written in Python. I would like to put that code in a webpage. Brython seems like the simplest way to glue the two things together, but I don't have a server that can actually run code on the server side. Does Brython require server-side code, or can I host a page using it on the cheap with (say) Dropbox? 回答1: Brython itself seems to be completely client side, but whether that will be enough really depends on the code you wrote. It is not a full blown Python interpreter

Is Brython entirely client-side?

风格不统一 提交于 2019-12-02 22:40:57
I have a piece of code written in Python. I would like to put that code in a webpage. Brython seems like the simplest way to glue the two things together, but I don't have a server that can actually run code on the server side. Does Brython require server-side code, or can I host a page using it on the cheap with (say) Dropbox? Brython itself seems to be completely client side, but whether that will be enough really depends on the code you wrote. It is not a full blown Python interpreter and does not have the libraries. You might want a backend to support it or use another client side solution

Import PSAW brython

我是研究僧i 提交于 2019-12-02 10:47:33
I am trying to import the PSAW library in python using Brython, I have the following code: <!DOCTYPE html> <html> <head> <script type="text/javascript" src="brython.js"></script> <script type="text/javascript" src="brython_stdlib.js"></script> </head> <body onload="brython()"> <script type="text/python"> from browser import document document <= "Hello world !" </script> </body> </html> This works correctly, however when i add PSAW like so: <!DOCTYPE html> <html> <head> <script type="text/javascript" src="brython.js"></script> <script type="text/javascript" src="brython_stdlib.js"></script> <

Import PSAW brython

牧云@^-^@ 提交于 2019-12-02 07:36:06
问题 I am trying to import the PSAW library in python using Brython, I have the following code: <!DOCTYPE html> <html> <head> <script type="text/javascript" src="brython.js"></script> <script type="text/javascript" src="brython_stdlib.js"></script> </head> <body onload="brython()"> <script type="text/python"> from browser import document document <= "Hello world !" </script> </body> </html> This works correctly, however when i add PSAW like so: <!DOCTYPE html> <html> <head> <script type="text