FAQ
Hi all,

I'd like to know how do you guys find out what's happening in your
code if the process seems not work.
In java, I will use jstack <pid> to check stacks of threads and lock status.
But I don't know how to do it in python.

--
Best Regards,
Leo Jay

Search Discussions

  • Ulrich Eckhardt at Nov 29, 2010 at 3:40 pm

    Leo Jay wrote:
    I'd like to know how do you guys find out what's happening in your
    code if the process seems not work.
    In java, I will use jstack <pid> to check stacks of threads and lock
    status. But I don't know how to do it in python.
    import pdb
    pdb.set_trace()

    Generally, searching "python debugger howto" should turn up a few useful
    results. ;)

    Uli

    --
    Domino Laser GmbH
    Gesch?ftsf?hrer: Thorsten F?cking, Amtsgericht Hamburg HR B62 932
  • Michele Simionato at Nov 29, 2010 at 4:53 pm

    On Nov 29, 7:01?am, Leo Jay wrote:
    Hi all,

    I'd like to know how do you guys find out what's happening in your
    code if the process seems not work.
    In java, I will use jstack <pid> to check stacks of threads and lock status.
    But I don't know how to do it in python.

    --
    Best Regards,
    Leo Jay
    If you give a CTRL-C the Python process will die with a traceback
    showing the line where the process
    got stuck (assuming you started it from the command-line). You can
    even run the script under the debugger and give a CTRL-C after a
    while, as follows:

    $ python -m pdb thescript.py
    (Pdb) c
    <wait a bit ...>
    CTRL-C
    Traceback ...
    ...
    (Pdb) <inspect the variables and continue if you like>

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedNov 29, '10 at 6:01a
activeNov 29, '10 at 4:53p
posts3
users3
websitepython.org

People

Translate

site design / logo © 2022 Grokbase