467,861 Members | 1,446 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,861 developers. It's quick & easy.

stop program and start interactive interpreter


I seem to remeber reading somewhere there was a statement you could
put in your python program to stop its execution and start the
interactive interpreter at that point (and then you could change the
value of some variables and continue executing). Am I having delusions
or is there a way to do this?

Thanks,
Dave


Jul 18 '05 #1
  • viewed: 3273
Share:
2 Replies
Dave Reed <dr*****@columbus.rr.com> writes:
I seem to remeber reading somewhere there was a statement you could
put in your python program to stop its execution and start the
interactive interpreter at that point (and then you could change the
value of some variables and continue executing). Am I having delusions
or is there a way to do this?


I think you're right, but don't recall how you do it.

python -i spam.py

might be good enough for you, though
John
Jul 18 '05 #2
Dave Reed wrote:

I seem to remeber reading somewhere there was a statement you
could put in your python program to stop its execution and start
the interactive interpreter at that point (and then you could
change the value of some variables and continue executing). Am I
having delusions or is there a way to do this?

Thanks,
Dave


Take a look at IPython. It provides both an enhanced Python
command line and an interactive shell that you can call from within
your Python source code. However, I believe that if you change the
value of variables, those new values are lost when you exit the
IPython shell and continue execution.

http://ipython.scipy.org/

The manual is at:

http://ipython.scipy.org/doc/manual/index.html

And the part of the manual about the interactive shell is at:

http://ipython.scipy.org/doc/manual/node9.html

Hope this helps.

(another) Dave

--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
dk******@rexx.com
Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

147 posts views Thread by Sateesh | last post: by
7 posts views Thread by B.G.R. | last post: by
29 posts views Thread by 63q2o4i02 | last post: by
6 posts views Thread by bruce | last post: by
6 posts views Thread by Alan Isaac | last post: by
3 posts views Thread by Sal | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.