Folks:
I've got a jython script which creates a java object which runs a
bunch of other jython scripts. Basically, the problem I'm seeing
is as follows:
####################################
launcher.py:
from java.util import Vector
from mystuff import JythonLauncher
v = Vector()
v.add( "launchee.py" )
# initialize v with some other stuff...
jl = JythonLauncher( v )
jl.launch() # runs launchee.py with an instance of PythonInterpreter
############################################
###########################################
launchee.py:
print "Here 1"
from java.util import Vector
print "Here 2"
# other stuff...
###########################################
I run launcher.py from the jython command prompt as follows:
>>> from launcher import *
What I see is that launchee.py is, in fact, launched because
I see "Here 1" printed out. However, "Here 2" never appears.
The launchee.py script seems to hang at the "from java.util import
Vector"
line. Strangely, if I do:
jython launcher.py
things seem to work OK (i.e., I get "Here 2" printed out).
Also, when I hacked things up so that launchee.py didn't need Vector
things went OK (it needed to import other stuff but that didn't faze
it).
Is there some limit to the number of times I can import stuff? Is there
a work-around to this problem? My "Learning Python" book has given me
few clues (I tried reload() but that didn't seem to work, either).
Thanks,
---Rob Welch
|