python script launches shell

Skip Montanaro skip at pobox.com
Fri Sep 21 10:54:53 EDT 2001


    John> I have a long script that I would like to run and then launch the
    John> python shell so that I can access all the vars and funcs defined
    John> in the script interactively.  Is this possible.  I know I can
    John> luanch python and then paste in the script, but because it is long
    John> it is a pain.

Try running your script from the shell using the -i flag.  From "python
--help:" 

    -i     : inspect interactively after running script, (also PYTHONINSPECT=x)
             and force prompts, even if stdin does not appear to be a terminal

-- 
Skip Montanaro (skip at pobox.com)
http://www.mojam.com/
http://www.musi-cal.com/




More information about the Python-list mailing list