![]() |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Invoking the JPython InterpreterJPython can be invoked from the shell using the following command: jpython [options] [-jar jar | -c cmd | file | -] [args]Options and arguments:
Detailsjpython 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.jpython. Making JPython Scripts ExecutableTo make a jpython ".py" file executable on a Unix system you can add the following line to the top of the file: #! /usr/bin/env jpython For this magic to work, you must have jpython 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: "#! <...>/jpython" will probably not work to make your script executable. This is because "jpython" 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. |