logo       

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

lang.jython.user

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

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@xxxxxxxxx
url: http://user.et-cip.rub.de/hammadi/
http://jprog.blogspot.com/
N�HS^�隊X���'���u��<�ڂ�.���y�"� �*m�x%jx.j���^�קvƩ�X�jب�ȧ��m�ݚ�����v&��קv�^�+����j�Z����{az����^��h��஋�n���)��{h�����ا�׫�+h�(m�����Z��jY�w��ǥrg
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise