try:
from myapp.util import UtilClass
cheers,
jason songhurst
-----Original Message-----
From: John Goerzen [mailto:jgoerzen@...]
Sent: Friday, August 31, 2001 3:54 PM
To: jython-users@...
Subject: [Jython-users] import problems
Hi,
In my .py file (again compiled with jythonc to be called from java), I
have something like this:
import java
from java.myapp.util import UtilClass
I get a runtime error complaining that the "myapp" module does not
exist. What is the proper way of doing this? (Note that all sorts of
other things find myapp.util.UtilClass without problems.)
-- John
_______________________________________________
Jython-users mailing list
Jython-users@...
http://lists.sourceforge.net/lists/listinfo/jython-users

Hi John,
On Fri, 31 Aug 2001, John Goerzen wrote:
> Hi,
>
> In my .py file (again compiled with jythonc to be called from java), I
> have something like this:
>
> import java
> from java.myapp.util import UtilClass
>
> I get a runtime error complaining that the "myapp" module does not
> exist. What is the proper way of doing this? (Note that all sorts of
> other things find myapp.util.UtilClass without problems.)
The difference between your import line and your last sentence confused me
a bit. Excuse the confusion, but Is the package declared as
"myapp.util.UtilClass" or "java.myapp.util.UtilClass"? If the actual
package name is myapp.util.UtilClass, then the import should be changed
to:
from myapp.util import UtilClass
If I'm just confused about the package name, and the import really right,
then try giving a Java package hint to the SystemState with
sys.add_package(packagename):
import java, sys
sys.add_package(java.myapp.util)
from java.myapp.util import UtilClass
-robert

Hi,
In my .py file (again compiled with jythonc to be called from java), I
have something like this:
import java
from java.myapp.util import UtilClass
I get a runtime error complaining that the "myapp" module does not
exist. What is the proper way of doing this? (Note that all sorts of
other things find myapp.util.UtilClass without problems.)
-- John

Hi,
I'm trying out Jython for the first time but the documentation have
not covered this scenario:
I want to make a class that is callable by Java, that is a child only
of java.lang.Object, whose constructor can take 0 or 1 arguments.
There seems to be no way to specify two @sig lines. Eg:
import java
class Foo(java.lang.Object):
def __init__(self, arg=None):
"""@sig public Foo()
@sig public Foo(String arg)"""
if arg:
print arg
else:
print "No arg passed"
However this is unacceptable to Jython. How does one do this?
--
John Goerzen <jgoerzen@...> GPG: 0x8A1D9A1F http://www.complete.org