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 friend. (Like all well-
behaviour apps, python should come with a man page.) `python --help` is
useful too, and will be platform independent. Both tell me that you want
to pass -i as an option to enter the interactive interpreter after
running a module or command:
[steve@sylar ~]$ python -c "print 'hello world'; x = 2"
hello world
[steve@sylar ~]$ python -i -c "print 'hello world'; x = 2"
hello world2
You can also set an environment variable to force the same behaviour. See
the help for details.