how to print a traceback?

Discussion in 'Python' started by sndive@gmail.com, Oct 16, 2007.

  1. Guest

    i'm struggling to get some proxy code working with liburl[2] and want
    to print
    some tracebacks in my class ProxyHTTPConnection::request().
    do i have to force an exception and print a backtrace in catch or
    can i just print the current stack?
    print_tb takes an argument and short of forcing an exception
    i don;t know where to get the current backtrace object from.

    thanks.
     
    , Oct 16, 2007
    #1
    1. Advertising

  2. En Tue, 16 Oct 2007 01:03:08 -0300, <> escribi�:

    > i'm struggling to get some proxy code working with liburl[2] and want
    > to print
    > some tracebacks in my class ProxyHTTPConnection::request().
    > do i have to force an exception and print a backtrace in catch or
    > can i just print the current stack?
    > print_tb takes an argument and short of forcing an exception
    > i don;t know where to get the current backtrace object from.


    from traceback import print_stack
    print_stack()


    --
    Gabriel Genellina
     
    Gabriel Genellina, Oct 16, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Saizan
    Replies:
    5
    Views:
    336
    Fabio Zadrozny
    Feb 2, 2006
  2. keto
    Replies:
    0
    Views:
    964
  3. David Cournapeau

    print a vs print '%s' % a vs print '%f' a

    David Cournapeau, Dec 30, 2008, in forum: Python
    Replies:
    0
    Views:
    363
    David Cournapeau
    Dec 30, 2008
  4. Gerald Britton
    Replies:
    0
    Views:
    228
    Gerald Britton
    Feb 13, 2011
  5. Jack Bates
    Replies:
    0
    Views:
    281
    Jack Bates
    May 2, 2011
Loading...

Share This Page