i am sure that if ben fry and casey reas would start processing today they would use python instead of java. learning the short and efficient python is much easier than the statically typed and lengthy java. no compilation would be necessary anymore, tons of native libraries would be available via c-bindings, etc. nodebox is a nice example of the use of python for computational design. unfortunately it is restricted to os x.
today we are using python for all sorts of automated code generation in wuerzburg. one example is the conversion of fluid simulation data into x3d files for our coperion project. jan and sebastian are using this approach for their simulated cities of their master projects.
i started a short proof of concept of a python based processing. jython is an implementation of python in java. with its help it’s possible to write code with the processing api in python language.
code example (helloProcessing.py):
from processing.core import PApplet
Â Â Â Â def setup(self):
Â Â Â Â Â Â Â Â Â global p
Â Â Â Â Â Â Â Â Â p = self
Â Â Â Â Â Â Â Â Â p.size(350, 350)
Â Â Â Â def draw(self):
Â Â Â Â Â Â Â Â Â p.fill(p.random(255))
Â Â Â Â Â Â Â Â Â p.rect(150, 150, 50, 50)
Â Â Â Â if __name__ == ‘__main__’:
Â Â Â Â Â Â Â Â Â import pawt
Â Â Â Â Â Â Â Â Â pawt.test(HelloProcessing())
1. just download and install jython:
2. put you processing libs into java classpath or modify the startup file (jython) in order to do so:
# This file was generated by the Jython installer
# Created on Mon May 19 20:25:40 CEST 2008 by me
if [ ! -z “$CLASSPATH” ]
“/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/java” -Dpython.home=”/Users/me/jython2.2.1″ -classpath “$CP” org.python.util.jython “$@”
3. start the python file in your shell: