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)


now the program y.py look's somting like this:

from x import *
a = X()
a.hello()

another form to use your library:

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





Aziz Hammadi <aziz.hammadi@gmail.com> escribi:
I wrote a jython class bus I can not use it in another jython script :-(
Example:
---------------------- X.py----------------------
class X:
def hello():
print "Hello"


---------------------- Y.py----------------------
import X
x = X()
x.hello()


I get TypeError: call of non function (module 'X')
Both files are in the same directory.

Tanks!

Aziz Hammadi



--
Aziz Hammadi Lamrani
email: aziz.hammadi@gmail.com
url: http://user.et-cip.rub.de/hammadi/
http://jprog.blogspot.com/
NHS^隊X'u<ڂ.y" *mx%jx.j^קvƩXjبȧmݚv&קv^+jZ{az^h஋n){hا׫+h(mZjYwǥrgy$Oxḝn5mj^؜왨x%Ihb,y+޶m+-.ǟ+-bا~h


Do You Yahoo!? La mejor conexin a Internet y 2GB extra a tu correo por $100 al mes. http://net.yahoo.com.mx