472,786 Members | 1,367 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,786 software developers and data experts.

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
2 3450
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

147
by: Sateesh | last post by:
Hi, I am a beginner in Python, and am wondering what is it about the indentation in Python, without which python scripts do not work properly. Why can't the indentation not so strict so as to give...
7
by: B.G.R. | last post by:
Hi all, I'm working on an interpreter for a university subject, which is programmed in python under linux. I got most of the work done and I'm just trying to settle some problems I've found on...
2
by: siggy2 | last post by:
Hi All, (sorry for my bad english) I wrote a __tiny__ and __stupid__ recursive script directly into pythonwin interactive window with a time.sleep(1) and a print before each recursion... I...
3
by: Tuang | last post by:
I'd like to create my own mini "IDE" for working with several programming languages that provide interactive "toplevel" command line interpreters, such as Python, Ruby, Lisp, Scheme, OCaml, etc....
29
by: 63q2o4i02 | last post by:
Hi, I'm interested in using python to start writing a CAD program for electrical design. I just got done reading Steven Rubin's book, I've used "real" EDA tools, and I have an MSEE, so I know what...
6
by: bruce | last post by:
hi... perl has the concept of "die". does python have anything similar. how can a python app be stopped? the docs refer to a sys.stop.. but i can't find anything else... am i missing...
6
by: John (Z R) L | last post by:
Hi all, I am very new to programming, and I chose to study the Python language before C++. I am currently using the Wikibooks "Non-Programmer's Tutorial for Python", and am up to the section "Who...
6
by: Alan Isaac | last post by:
I'm fairly new to Python and I've lately been running a script at the interpreter while working on it. Sometimes I only want to run the first quarter or half etc. What is the "good" way to do...
3
by: Sal | last post by:
I'm running PHP 5.2.6 on WindowsXP. When I try interactive mode with ">php -a" the slightest syntax error throws me out of the interpreter and back to the command line. This is not very useful....
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.