PROGRAMMING TUTORIAL

Sick of Using Javascript for the Web? Use Browser Python Instead

My experience building a Snake game with Brython

Yakko Majuri
The Startup
Published in
7 min readJul 5, 2020

--

Shoutout to David Clode

“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.

--

--

Yakko Majuri
The Startup

Programmer, writer, traveler, hitchhiker, climber, photographer. i.e. lost. (P.S. amateur at most of the above) // memoirsandrambles.substack.com