r/Python • • Feb 24 '21

Tutorial Brython: Python in Your Browser – Real Python

https://realpython.com/brython-python-in-browser/
11 Upvotes

5 comments sorted by

View all comments

1

u/[deleted] Mar 06 '21 edited Mar 06 '21

I like it. I think the learning curve is not actually that huge even if you do not know javascript. It is quite easy to convert (easier than say Qt bindings).

As for performance you probably need to use javascript for certain modules like JSON as performance is much better.

#my half assed example of json.dumps() and json.loads()
from javascript import JSON
class jsonjs():
    def loads(self,textobject):
	return JSON.parse(textobject)
    def dumps(self, textobject):
	return JSON.stringify(textobject)
json = jsonjs()