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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s