Processing.py

While Processing is a Java-based language, there have been implementations of it (with varying degrees of fidelity) in a few other languages. The best known of these is probably Processing.js, a brilliant bit of JavaScript that enables many Processing sketches to run unmodified in web browsers. There are other implementations that hybridize Processing with Ruby, Scala, CPython, and more. J. Feinberg’s Processing.py project is relatively new to this group, and I really like what he’s done with it so far.

Processing.py is built on Jython, a Python implementation running on the JVM, and it enables Processing functionality with Python’s sugary syntax. It supports both “static” and “active” sketches, sketch-specific global variables and methods, and all included Processing renderers. It is distributed as a .jar and to play with it you do not need Jython. Below is a toy syntax comparison:

Processing

Processing.py

These sketches produce the same result when run, but the Processing.py version doesn’t have brackets, semicolons, or return types. This is exciting in itself, but it does more. I’ve rewritten Daniel Shiffman’s Wolfram CA example to show off some of the differences you’ll encounter between Processing.py and pure Processing. Some of the examples are contrived, some are more practical.

More information

Full instructions and a quick start guide are available in the project’s readme. You can run my gist, try the included examples, and write your own. Additional information about the details of the implementation itself are available in a Google Docs presentation here.