jython include import


==file: foo.py

class foo:
def hello(self):
print 'hello foo'

==file: bar.py

import foo

f = foo()
print f.hello()

at command prompt:

jython bar.py

prints:

hello foo

For the mechanics of how jython finds foo.py, see

"The Module Search Path" at

http://www.python.org/doc/current/tut/node8.html#SECTION008110000000000000000

file extension must be .py

Advertisements

Jython Registry

Because there is no good platform independent equivalent of the Windows
Registry (or Unix envrionment variables) Java has it’s own environment
variable namespace. Jython aquires it’s namespace from the following
three sources (later sources override defaults found in earlier
places).
Continue reading