From: Edward P. <epo...@te...> - 2002-01-30 02:18:26
|
Hello All, My Jython app creates and uses a few org.python.util.PythonInterpreter's. It looks something like this: |-----Shared namespace ------------| Main app Interpreter Interpreter Interpreter So the interpreters and the main app share a namespace. Can anyone answer these questions: o If a script executed within one interpreter alters the state of the main application (ie, a scripted class is added to some application list), and the interpreter is deleted, what happens. Is the interpreter really deleted, or is some reference going to be dangling about. If it is deleted, is the scripted class 'ok', or will weird and unpleasant things happen. o Each interpreter redefines sys.stderr. It seems that stderr is unique amongst all interpreters within an app. Is there another way to deal with this? I redefined both sys.stderr via interpreter.exec() calls, and interpreter.setOut() ... same result. I can think of hacky ways to deal with this, but there might be an easy solution out there. o Anything else I should be aware of. From some stuff in the archive, I see only one person saying that they had problems when interpreters were in diff threads. But no solutions. Sorry if these are basic questions, I have been only using Jython for about 2 months, but am having such a blast that it is my main dev language now. Thanks, -Ed |