[PythonCE] Re: Runing python without the pcceshell

Richard Deeley r_deeley at yahoo.com
Thu Apr 1 21:27:32 EST 2004


comments after the code.

runCode:
...
if file:
   bInteract = 0 
   bkeepOpen = 0
   try:
      try:
          imp.load_module(...)
      except SystemExit:
           pass
      except:
           traceback.print_exc()
           bkeepOpen = 1
   finally:
      file.close()

and in the main body:

#commented out
#sys.stderr = shell 
#sys.stdout = shell

and don't use -c. 


I think the best solution long term is to add option to pcceshell
that supports this functionality. Indeed, it seems from the names 
of the variables that this was one of the original intentions.
As I recall, pcceshell is a required part of this whole thing and
anything that executes has to go through here. If not, forget
anything I just said, there may be a much simpler way through all
this.

The bInteract issue isn't resolved properly here (the original code 
forced it to a 1 under all conditions), but it will fix the issue for 
the  intended purpose. You will get a shell and traceback window if
the thing dies. Otherwise output goes to the terminal window
(for which I use a DOS terminal emulator).


Richard.


> I remmember a while back that Richard Deeley wrote something aboutbtweeking pcceshell, so that
> you could run Python without the shell.
> I would like to know where Ibcan get more info. On this.
> 
> Thanks
> All the best
> 
> Isr Gish
> 


__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/



More information about the PythonCE mailing list