Appendix B. Jython Options and Registry
This appendix covers the options you can use when invoking jython or jythonc from the command line. In addition, it covers the Jython registry, which is where Jython looks for system-specific values such as the path for Python modules.
Jython Options
The actual jython file on your system is a
very short batch or shell script. All it does is start your Java Virtual
Machine (JVM), set the Java python.home property, and
call the main( ) function of the
org.python.util.jython main interpreter class.
The basic structure of a call to jython is
zero or more flags, followed by an optional source argument. If there is
a source argument, any number of optional program arguments can follow
it. Any program arguments are passed to the source in the
sys.argv array (as is typical among command-line
arguments, the first element in the array sys.argv[0]
is the path of the source itself).
jython [options] [source] [args]The command-line options are as follows:
-Dprop=valueSets a Jython property value
proptovalue. Overrides any registry value for that property.-iRuns the source script, then invokes the interpreter to allow inspection of the state after the script runs.
- -E
codec Sets
codecfor reading characters from the console.-SBy default, Jython imports a module named site.py on startup if it exists. Using this flag suppresses that default.
--helpPrints a help message and exits.
--versionPrints a version message and exits.
The source options are as follows. If no ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access