can't get import to work!

corsairdgr at aol.com corsairdgr at aol.com
Mon Jan 15 18:35:06 CET 2007


 I am brand new to jython/python.
 
 I want to use my own Java class from within a Jython script.
 
 In Java, I created a class called Fubar and put this in a jar file called testit.jar.
 The Fubar class is in the just.for.fun package and this path shows up in the
 testit.jar file. I then modified the jython.bat file (I'm using windows) to include
 the testit.jar file in the classpath. When jython starts from the command line,
 it notices testit.jar and generates some cache information.
 
 Next I want to use the Fubar class in a jython script. I start jython from the command line and type:
 
 from just.for.fun import Fubar
 This doesn't work. The following error is displayed:
 ImportError: No module named for
 
 I also try
 
 import just.for.fun.Fubar
 
 This gives the same error.
 
 I can enter import java.util.HashMap and other such imports and these work. 
 
 Can someone please tell me what I could be doing wrong ?
 
 Thanks,
 
 
 
  
________________________________________________________________________
Check out the new AOL.  Most comprehensive set of free safety and security tools, free access to millions of high-quality videos from across the web, free AOL Mail and more.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070115/be8b0fa3/attachment.html>


More information about the Python-list mailing list