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


hello foo

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

"The Module Search Path" at


file extension must be .py


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
Continue reading