473,396 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 3487
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.