From: dimo j. <di...@ho...> - 2001-09-05 18:55:23
|
In my earlier post I should have specified: I'm using the interact.py that is given as example on page 799 of Programming Python by Mark Lutz. Specifically, I'm using the InteractiveApp class to create a read-eval loop. My bad, sorry! -Dimo >From: "dimo jones" <di...@ho...> >To: jyt...@li... >Subject: [Jython-users] interact.py issues >Date: Wed, 05 Sep 2001 10:50:18 -0400 > >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 > > >_______________________________________________ >Jython-users mailing list >Jyt...@li... >https://lists.sourceforge.net/lists/listinfo/jython-users _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp |