Debugging a script

  • Thread starter Graham Nicholls
  • Start date
G

Graham Nicholls

I've got a (python) program which crashes. WHat I'd like to do is something
loke this:

try:
lots of stuff, or
more pertinintly, the code which is failing
except:
drop in to the debugger

So that I can print various things.

Also, is there a way to display the line number - eg:
except something:
print ("DEBUG: exception %s at line number %s" % (sys.exc_type,
sys.linenumber))

Thanks
Python 2.3 (#1, Sep 11 2003, 14:36:40)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,174
Messages
2,570,940
Members
47,486
Latest member
websterztechnologies01

Latest Threads

Top