def pv(name):
    record = inspect.getouterframes(inspect.currentframe())[1]
frame = record[0]
val = eval(name, frame.f_globals, frame.f_locals)
Printing Variable names and contents as debugging tool; looking for emacs/Python shortcut