using trace to do 'in place' evaluation of variables

Discussion in 'Python' started by Edward Peschko, Dec 7, 2010.

  1. All,

    I've been using the trace module for python (as per
    http://www.dalkescientific.com/writings/diary/archive/2005/04/20/tracing_python_code.html),
    and would very much like to have a feature there that I've implemented
    for perl already.

    Namely, I would like output in the format as described on that page,
    but with the ability to have the running window partitioned into 2,
    like:


    /tmp/file.py:13: yy = 12 | = 12
    /tmp/file.py14: xx = yy | = 12

    where the window on the left shows the actual source code, and the
    right shows how that code eval's (ie: how the scalars resolve based on
    their current scope.)

    Is this possible given the current trace functionality? I've found it
    an *incredible* time saver with my perl code, especially for hard to
    find data bugs - to debug I simply look for a pattern which is
    associated with a given bug, and then backtrack that pattern to where
    it first appeared in my code.

    Also, is there a good archive searcher for the python-list archives?
    Short of doing a complete download of
    http://mail.python.org/pipermail/python-list/ and indexing it, I don't
    see how I can do a decent pattern search on previous archive entries..

    Thanks much,

    Ed
    Edward Peschko, Dec 7, 2010
    #1
    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. Rukmal Fernando
    Replies:
    4
    Views:
    853
    Richard Grimes [MVP]
    Oct 27, 2003
  2. Matthias S.
    Replies:
    1
    Views:
    653
    Daniel Fisher\(lennybacon\)
    Nov 30, 2005
  3. Ilias Lazaridis
    Replies:
    2
    Views:
    391
    Ilias Lazaridis
    Apr 24, 2005
  4. Ilias Lazaridis
    Replies:
    74
    Views:
    757
    Ilias Lazaridis
    Apr 4, 2005
  5. Ilias Lazaridis
    Replies:
    18
    Views:
    333
    Bill Guindon
    Apr 9, 2005
Loading...

Share This Page