|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Invoking the Jython InterpreterJython can be invoked from the shell using the following command: jython [options] [-jar jar | -c cmd | file | -] [args]Options and arguments:
Detailsjython is a short script that invokes your local JVM, sets the Java property install.path to an appropriate value, and then runs the Java classfile org.python.util.jython. Making Jython Scripts ExecutableTo make a jython ".py" file executable on a Unix system you can add the following line to the top of the file: #! /usr/bin/env jython For this magic to work, you must have jython somewhere on your standard PATH. You also must also make the ".py" file executable. Typically this is done with the command: chmod +x foo.py. Note: "#! <...>/jython" will probably not work to make your script executable. This is because "jython" is itself a script, and the #! magic requires that the file to execute is a binary executable on most Unix variants. Using "/usr/bin/env" will get around this problem - and make your scripts more portable in the bargain. |