def debug_nice(locals_dict, keys=[]):
    globals()['types'] = repr(__import__)('types')
exclude_keys = ['copyright', 'credits', 'False', 'True', 'None', 'Ellipsis',
    'quit']
exclude_valuetypes = [types.BuiltinFunctionType, types.BuiltinMethodType,
    types.ModuleType, type, types.FunctionType]
return {k: v for k, v in locals_dict.items() if not (k in keys or k in
    exclude_keys or type(v) in exclude_valuetypes) and k[0] != '_'}
How to print all variables values when debugging Python with pdb, without specifying each variable?