Questions tagged [brython]

Brython is a browser-integrated Python engine.

Brython stands for Browser's Python. It's goal is to replace JavaScript with Python as the scripting language for web browsers. It is composed of a lightweight run-time translation layer that brings many of Python's syntax niceties directly to the browser, as simple as using a <script type="text/python"> tag.

Some possible uses are

  • Creating simple document elements,
  • Drag and drop elements
  • 3D navigation
  • Geolocation
  • Charts and graphs

For more examples visit the home page and refer to the gallery.

Brython is open source and the source code is available here. Documentation can be found at http://www.brython.info/doc/en/index.html.

108 questions
3
votes
1 answer

HTML, Python, Brython, javascript - running on Brython

Help run a simple program in Python using Brython. The basis is taken (it did not work) file from the example http://www.brython.info/gallery/pygame/chimp.html There are 3 files in the same directory: Eventlist.html,py_VFS.js, brython.js. py_VFS.js:…
EmptyMan
  • 297
  • 1
  • 4
  • 25
3
votes
1 answer

Can I use brython to develope Chrome extensions?

First, thank you for all your help, since this question has bothered me for a few days. I am not a native speaker of English, so if I make some grammar mistakes or describe the questions unclearly, please forgive me. :) Originally, I was a crawler…
Mars Lee
  • 1,845
  • 5
  • 17
  • 37
3
votes
1 answer

Invoke Brython function from JavaScript

EDIT: Google Group post I'm playing with Brython. I'm trying to figure out how to execute Brython code from JavaScript. http://www.brython.info/static_doc/en/jsobjects.html <-- this looks like the relevant documentation page, but it seems to be…
P i
  • 29,020
  • 36
  • 159
  • 267
3
votes
1 answer

Brython: Moving Elements Every [...] Microseconds

Good night. This is a question about Brython and any help will be welcome. I'm looking for a way of moving elements (for example, a div) some pixels to the left (or to the right, top etc.) every time interval (perhaps 200 milliseconds). Can anyone…
2
votes
1 answer

How to import python modules using Brython and Flask app

I am using Flask for my backend and brython for my client side since I need to use python modules that aren't available for javascript. At the moment, I am having trouble with importing modules from different folders. For instance, suppose I wanted…
relyt
  • 21
  • 3
2
votes
1 answer

Can I obtain the parameters of the website using Brython?

I am currently trying to use Brython for the website I am making, but I cannot get the data from the user for my program. I set up a box for the user to type in an ID...
triplered
  • 87
  • 8
2
votes
1 answer

How to import python modules in the python script using brython

I intend to create a small app that uses Brython to convert .xlsx files to .csv files. I used Brython so I can write my code in python instead of javascript. However, I cant upload pandas for some reason. Here is my code:
2
votes
0 answers

Has anyone used Brython with Wordpress?

I'm a fan of moving fast. I love WordPress (and available themes) and Python because I can develop concepts and prototype quickly. I'm not a fan of jscript.... I'm wondering if anyone has tried to use Brython with WordPress to create some…
warchitect
  • 397
  • 1
  • 4
  • 15
2
votes
1 answer

Python/Brython create button on a website

Is it possible to create a button on a website (like tampermonkey scripts do) with Brython ? Or is there an alternative to Tampermonkey(JavaScript), based on python(or similar) ? My knowledge of JavaScript is 0 , thats why i'm avoiding it. Thanks.
Matr1x
  • 57
  • 2
  • 10
2
votes
1 answer

How to import numpy or the other library using brython

I want to use numpy in brython. But I do not know how to import extra modules in brython. If you have similar experience or question, please tell me way to solve
2
votes
0 answers

How to Debug Redirect Loops in flask

This question is not really about any specific code, but I am using flask and I would like to know what are the best ways to debug redirect loops as they do not appear as errors in either the werkzeug or the browser terminal. Any response is…
user11726874
2
votes
1 answer

How can I init brython without onload in

It seems that initializing brython requires to be done like so: I tried calling brython() in js in another (StringIO came from https://svn.python.org/projects/python/trunk/Lib/StringIO.py with removed…
jcubic
  • 61,973
  • 54
  • 229
  • 402
2
votes
2 answers

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

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 :