On May 20, 6:57 pm, Brendan Miller <catph...@catphive.net> 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, line): ... exec line in globals() ... >>> MyCmd().cmdloop() (Cmd) s = 'The answer is probably to use %s' (Cmd) print s % 'the cmd module' The answer is probably to use the cmd module (Cmd) Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list