Member-only story
PROGRAMMING TUTORIAL
Sick of Using Javascript for the Web? Use Browser Python Instead
My experience building a Snake game with Brython
“Wait, what?” is how I expect most people to react to the title of this article.
What do you mean by “Just Use Browser Python”?
Everybody knows browsers can only run JavaScript.
Well, below is a screenshot of my personal website’s source code, see if you notice something different:
Yes, it’s Python!
And now, let’s talk about how that works, how well it works, and what other alternatives to browser JS exist out there.
Introducing Brython
Brython is a Python3 implementation written in JavaScript, which allows you to write Python code for the web.
Effectively, it’s a JavaScript library that converts your Python code into equivalent JS and evaluates it at runtime.
And since writing Python for the browser sounds pretty cool, I decided to give it a shot.