Re: starting repl programmatically

2010-05-20 Thread Steven D'Aprano
On Thu, 20 May 2010 17:11:17 -0700, Brendan Miller wrote: > python -i myscript.py > > almost does what I want. The only problem is if I exit with exit(0) it > does *not* enter interactive mode. I have to run off the end of the > script as near as I can tell. Is there another way to exit without >

Re: starting repl programmatically

2010-05-20 Thread Patrick Maupin
On May 20, 6:57 pm, Brendan Miller wrote: > I have a python script that sets up some environmental stuff. I would > then like to be able to change back to interactive mode and use that > environment. What's the best way to do that? >>> import cmd >>> class MyCmd(cmd.Cmd): ... def default(self,

Re: starting repl programmatically

2010-05-20 Thread Steven D'Aprano
On Thu, 20 May 2010 16:57:40 -0700, Brendan Miller wrote: > I have a python script that sets up some environmental stuff. I would > then like to be able to change back to interactive mode and use that > environment. What's the best way to do that? On most(?) Linux distros, `man python` is your fr

Re: starting repl programmatically

2010-05-20 Thread Brendan Miller
python -i myscript.py almost does what I want. The only problem is if I exit with exit(0) it does *not* enter interactive mode. I have to run off the end of the script as near as I can tell. Is there another way to exit without breaking python -i? On Thu, May 20, 2010 at 4:57 PM, Brendan Miller

starting repl programmatically

2010-05-20 Thread Brendan Miller
I have a python script that sets up some environmental stuff. I would then like to be able to change back to interactive mode and use that environment. What's the best way to do that? -- http://mail.python.org/mailman/listinfo/python-list