def dbg_print_vars(*args):
 import inspect
 parent_locals = inspect.currentframe().f_back.f_locals
 maps = []
 for arg in args:
  for (name, value) in parent_locals.items():
   if (id(arg) == id(value)):
    maps.append((name, repr(value)))
    break
 print('\n'.join((((name + '=') + value) for (name, value) in maps)))

def dbg_print_vars ( * args ) : import inspect parent_locals = inspect . currentframe ( ) . f_back . f_locals maps = [ ] for arg in args : for ( name , value ) in parent_locals . items ( ) : if ( id ( arg ) == id ( value ) ) : maps . append ( ( name , repr ( value ) ) ) break print ( '\n' . join ( ( ( ( name + '=' ) + value ) for ( name , value ) in maps ) ) )
prints name and repr of each arg on a separate line .