Skip to main content


Use the Python and the PyGame library in your browser/nodewebkit!

Asher Wolfstein
It requires a bit of reprogramming on the side of the PyGame application to take advantage of the modified event loop and such. And not every piece of PyGame is supported (up to about 1.7-1.8) but it works. It uses Brython ( to execute Python in the browser, and then using that Python you can import PyGame and use it. PyGame modules map to various Javascript libraries handling graphics, sound, and user input.



Home Page


PYGJS 1.0 — 29 Jun, 2017 account Comments

  • jmm0 2017-10-26 23:07

    How would I get the demo running? I tried downloading the repo (, extracting it, starting a web server in the directory where I'd extracted the repo (python -c "__import__('SocketServer').TCPServer(('localhost', 80), __import__('SimpleHTTPServer').SimpleHTTPRequestHandler).serve_forever()"), and opening http://localhost in a modern browser; the page doesn't load successfully. Do I need to use a sophisticated web server? Are there dependencies I must install? Is pygjs OS-agnostic?

    jmm0 2017-10-27 22:39

    Update: I figured out that the demo actually is doing something, though it is behind the scenes. It prints "update" and "draw" to the console a lot.