1

I have an object oriented program and I want to stop execution and maintain the python memory of all the variables that were in memory during execution.

I want to do that so that I can experiment with my variables and program with them in the python shell.

sys.exit() finish python execution, not only the script, it is not what I want.

2 Answers 2

6

Using the following Python statements should solve your problem. It involves using the debugger.

import pdb
pdb.set_trace()
Sign up to request clarification or add additional context in comments.

1 Comment

This is the tool for the job.
1

So what you want is to debug your program, try pdb which is the python debugger

http://docs.python.org/library/pdb.html

Or if you prefer you can use Eclipse with PyDevelop to have a friendlier user interface :)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.