logo       

Re: Re: Simple but fundamental: How to import a jython class?: msg#00028

lang.jython.user

Subject: Re: Re: Simple but fundamental: How to import a jython class?

Red Crow wrote:
If you want use the class X write this:

from x import * (x if yor archive is x.py and X if your archive is X.py)

This is generally considered bad style. It makes it hard to figure out where definitions come from in the importing program, and can lead to surprises where you import more than you intend.

another form to use your library:

import x (x if yor archive is x.py and X if your archive is X.py)

This is much better. You can also use
from x import X

if you don't want to have to type the module name everywhere you use X.

Kent



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise