From: dimo j. <di...@ho...> - 2001-09-05 14:50:24
|
Hello, I am running into problems using the app subclass interact.py. I would like the user to be able to enter jython language at the interactive prompt (not the >>> jython prompt, but the shell prompt created by interact.py), and have the language interpreted and executed appropriately. To achieve this, in the InteractiveApp evalCommand method I'm using exec and eval on the user-entered commands. The problem is that I can't maintain continuity between separate commands. For example, prompt/> a = 3 prompt/> b = a uncaught: (<class exceptions.NameError... ... NameError: a So there seems to be some namespace issue whereby I can't store the variables in the shell. Is what I'm attempting to do possible using interact.py? Note that I'm not planning on having the user enter anything more than one line of code at a time, i.e. no while, if, etc. I'm a newcomer to jython and would appreciate any input, Thanks Dimo _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp |