From: <bc...@wo...> - 2002-01-03 13:51:58
|
[Robert Welch] >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 * Something works for me: >>> from launcher import * Here 1 Here 2 >>> >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? No. >Is there a work-around to this problem? The real problem from my POV is that you didn't post your version JythonLauncer. Maybe it does not do the same thing as the one I had to add in order to test your example. Unless you post your version, we will never know. It might also be necessary to know how JythonLauncher is loaded. From the sys.path or the CLASSPATH? regards, finn |