|
Re: FW: problem with dictionaries (fwd): msg#00062lang.jython.user
Shweta, The problem is that Python has modules that are file based. This means that class dependancies within dependancies.py is referred to as depencies.dependencies . Java on the other hand has packages which are folder based, but not file based. This means that class dependancies withing dependancies.java is referred to as simply dependancies . Therefore dependencies.dependencies() in Python is referring to the class dependencies in the module dependencies while dependencies.dependencies() in Java is looking for the static method dependencies() belonging to the dependencies class. This all means that a = dependencies.dependencies() should read a = new dependencies(); Not forgetting that 'a' needs to declared with the correct type. For information on Java packages try here: http://java.sun.com/docs/books/tutorial/java/interpack/packages.html > But if I call this method dict_list in a java code > [ removing the above > two lines from test.py & compiling both test.py & > dependencies.py wiith > jythonc ] > and run that java class file ,then it gives > attribute error > saying that "class dependencies does not have an > attribute named > dependencies" > > public class testTest > { > public static void main(String[] args) > { > test a = new test(); > a.dict_list(); > } > } > [the jpywork directory was included in the > classpath] > > Looking forward to getting some guidance from you. > > Regards > Shweta Kesarwani > Infosys Technologies Ltd. > Contact at :6588668(Extn.1472) > > Be careful of your thoughts; they may become words > at any moment. -- > Iara Gassen > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Jython-users mailing list > Jython-users@xxxxxxxxxxxxxxxxxxxxx > https://lists.sourceforge.net/lists/listinfo/jython-users __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | creating custom arrays / extending java.util.ArrayList, justin worrall |
|---|---|
| Next by Date: | os.path gone away?, Tessa Lau |
| Previous by Thread: | FW: problem with dictionaries (fwd), Danny Yoo |
| Next by Thread: | creating custom arrays / extending java.util.ArrayList, justin worrall |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |