[Tutor] Taking over a program

Kent Johnson kent_johnson at skillsoft.com
Fri Nov 5 19:03:44 CET 2004

It sounds like you want the -i switch to the interpreter. If you type
 > python -i myprogram.py

Python will run myprogram.py normally, but when myprogram finishes, you 
will get an interpreter prompt and all the names from myprogram will be 


At 11:17 AM 11/5/2004 -0600, Hugo González Monteverde wrote:
>Hi Tutors,
>I'm trying to "take over" a program on the console, that is... write a 
>program, get it to run on its own up to a certain point, and then start 
>writing python statements in the console, keeping the variables and 
>program flow. Can it be done?
>This is basically for doing "what if" without having to write the whole 
>program in the console...
>Thanks for your help,
>Tutor maillist  -  Tutor at python.org

More information about the Tutor mailing list