def debugx(expr, pre_msg=''):
 cf = sys._getframe(1)
 print ('[DBG:%s] %s%s -> %r' % (cf.f_code.co_name, pre_msg, expr, eval(expr, cf.f_globals, cf.f_locals)))

def debugx ( expr , pre_msg = '' ) : cf = sys . _getframe ( 1 ) print ( '[DBG:%s] %s%s -> %r' % ( cf . f_code . co_name , pre_msg , expr , eval ( expr , cf . f_globals , cf . f_locals ) ) )
print the value of an expression from the callers frame .