Command Line - Jython/Python

LINUX USERS:

  • You will need to install libusb-1.0 before compiling a program. To do so, run sudo apt-get install libusb-1.0-0-dev in any terminal window.
  • You should download Jython from the website and install it.

1.  Download the Generic Jython package and unzip it to a convenient directory.

2.  Navigate to the SourceFiles directory.  

3.  Compile and run a file by using the following incantation, where FILEPATH is the location of your file relative to the SourceFiles:

Windows:  jython -Dpython.path=finch.jar FILEPATH

Mac:  jython -Dpython.path=finch.jar:jnaerator-0.9.5.jar FILEPATH

Linux: sudo jython -J-Djava.library.path=. -Dpython.path=finch.jar:jnaerator-0.9.5.jar FILEPATH

If you don't want to use sudo, follow these instructions to make it so regular users can access the Finch (credit: Meg Richards).

For example, if you wished to compile Dance.py, which is located in Code/Dance.py, you would use:

Windows:  jython -Dpython.path=finch.jar Code/Dance.py

Mac:  jython -Dpython.path=finch.jar:jnaerator-0.9.5.jar Code/Dance.py

Linux: sudo jython -J-Djava.library.path=. -Dpython.path=finch.jar:jnaerator-0.9.5.jar Code/Dance.py