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. Advertisements

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:
    1,078
    Richard Grimes [MVP]
    Oct 27, 2003
  2. Matthias S.
    Replies:
    1
    Views:
    845
    Daniel Fisher\(lennybacon\)
    Nov 30, 2005
  3. Ilias Lazaridis
    Replies:
    2
    Views:
    542
    Ilias Lazaridis
    Apr 24, 2005
  4. Jiho Han
    Replies:
    0
    Views:
    718
    Jiho Han
    Aug 22, 2006
  5. =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=

    Adding my messages to the trace.axd trace?

    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=, Apr 6, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    782
    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=
    Apr 6, 2007
  6. Chris Newby
    Replies:
    0
    Views:
    1,005
    Chris Newby
    Jul 28, 2008
  7. Ilias Lazaridis
    Replies:
    74
    Views:
    1,227
    Ilias Lazaridis
    Apr 4, 2005
  8. Ilias Lazaridis
    Replies:
    18
    Views:
    628
    Bill Guindon
    Apr 9, 2005
Loading...