473,322 Members | 1,718 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,322 software developers and data experts.

Interactive debugging

Hi, is there a way in python to place some sort of keyboard() type
statement which stops the script and puts you back at the console? I'm
looking for something like in matlab, where you place a keyboard()
command (I think), then you're in debug mode in the console, and you
type continue to re-enter the script where you left off. While you're
in the debugger/console you're at the scope where the keyboard() call
was and you can manipulate variables, etc. Is there something like
this in python? I've been using winpdb, which is great, but sometimes
I need more interactivity. Is this what pdb is about?

thanks
ms

Jun 26 '06 #1
2 1094
63*******@sneakemail.com wrote:
Hi, is there a way in python to place some sort of keyboard() type
statement which stops the script and puts you back at the console?


see the third example on this page:

http://effbot.org/librarybook/code.htm

</F>

Jun 26 '06 #2
63*******@sneakemail.com wrote:
Hi, is there a way in python to place some sort of keyboard() type
statement which stops the script and puts you back at the console? I'm
looking for something like in matlab, where you place a keyboard()
command (I think), then you're in debug mode in the console, and you
type continue to re-enter the script where you left off. While you're
in the debugger/console you're at the scope where the keyboard() call
was and you can manipulate variables, etc. Is there something like
this in python? I've been using winpdb, which is great, but sometimes
I need more interactivity. Is this what pdb is about?


Use

import pdb
pdb.set_trace()

The line where the set_trace() is invoked puts you back in the interpreter.

Diez
Jun 26 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Ashot | last post by:
This is sort of both Python and Vim related (which is why I've posted to both newsgroups). Python related: ---------------------- I have been frustrated for quite some time with a lack of a...
20
by: Joe | last post by:
When you run "python -i scriptname.py" after the script completes you left at the interactive command prompt. Is there a way to have this occur from a running program? In other words can I...
2
by: Charles Krug | last post by:
List: I'm trying to us pylab to see what I'm doing with some DSP algorithms, in case my posts about convolution and ffts weren't giving it away. I've been using pylab's plot function, but I'm...
6
by: Microsoft | last post by:
I'm new to CSharp, previously having done all my development in Delphi. I need to create a service, and for the development cycle I wish it to be an interactive service and use message boxes to...
1
by: Nick Palmer | last post by:
As the title suggests, I've got a question about running an ASP.NET app on a server that has no interactive desktop login. In all our testing of our app here,the server always had an interactive...
2
by: WJ | last post by:
I have three ASPX pages: 1. "WebForm1.aspx" is interactive, responsible for calling a web site (https://www.payMe.com) with $$$. It is working fine. 2. "WebForm2.aspx" is non-interactive, a...
3
by: Lubomir | last post by:
Hi, I read that interactive windows services will not be allowed to run under Wista. I would like to ask what exactly is the interactive service. It is supposed to be a service that communicates...
13
by: dmh2000 | last post by:
I am experimenting with the interactive interpreter environments of Python and Ruby and I ran into what seems to be a fundamental difference. However I may be doing something wrong in Python....
0
by: carl.dhalluin | last post by:
Hi I want a simple way to interactively remote debug a running python script which has no tty terminal attached to it. The scripts are running standalone (i.e. they are automatically started and...
3
by: R. Bernstein | last post by:
The next release of pydb will have the ability to go into ipython from inside the debugger. Sort of like how in ruby-debug you can go into irb :-) For ipython, this can be done pretty simply;...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.