Skip to main content

PYGJS - 1.0

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

  • Jason Marshall 2017-10-26 23:07:57.182887

    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?

    Jason Marshall 2017-10-27 22:39:50.918521

    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.