Skip to content

Instantly share code, notes, and snippets.

@endolith
Created May 23, 2009 03:40
Show Gist options
  • Save endolith/116485 to your computer and use it in GitHub Desktop.
Save endolith/116485 to your computer and use it in GitHub Desktop.
Python Processing using Jython in Ubuntu
from processing.core import PApplet
class HelloProcessing(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())
#!/bin/sh
# This file was generated by the Jython installer
# Created on Mon May 19 20:25:40 CEST 2008 by me
CP="/Users/me/jython2.2.1/jython.jar:/Applications/Processing/lib/core.jar"
if [ ! -z "$CLASSPATH" ]
then
CP=$CP:$CLASSPATH
fi
"/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 "$@"
#!/bin/sh
# Based on OS X script from http://i.document.m05.de/?p=483
# Until Bug #377135 is fixed, you'll need to manually edit this to
# point to wherever you put Processing
CLASSPATH="$HOME/Applications/Processing/lib/core.jar"
# (https://bugs.launchpad.net/ubuntu/+bug/377135)
# Note that if this path is wrong, it won't warn you in any way.
# Just try "import processing" to test if it worked.
# If CLASSPATH exists, it is appended by the /usr/bin/jython script, so let's just call that
export CLASSPATH
jython "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment