Thanks. I adapted it a bit:

def debug(foo):
    print foo, 'is:'
    exec('pprint.pprint(' + foo + ')')

But I'm getting "NameError: name 'foo' is not defined," since foo is
not defined in this scope. (The function works beautifully when I'm
dealing with global variables, which is very rarely).

Any way around this?

Rex

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to