Skip to content

Instantly share code, notes, and snippets.

@rochacbruno
Created February 9, 2021 23:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rochacbruno/f5add1e5de7e7c0ce7e1d153a3ca048f to your computer and use it in GitHub Desktop.
Save rochacbruno/f5add1e5de7e7c0ce7e1d153a3ca048f to your computer and use it in GitHub Desktop.
# from http://stackoverflow.com/questions/1623039/python-debugging-tips
# Ned's .pdbrc
# Print a dictionary, sorted. %1 is the dict, %2 is the prefix for the names.
# alias p_ for k in sorted(%1.keys()): print("%s%-15s= %-80.80s" % ("%2",k,repr(%1[k])))
alias p_ for k in sorted(%1): print("%s%-15s= %-80.80s" % ("%2", k, repr(%1[k]) ))
# Print the instance variables of a thing.
alias pi p_ %1.__dict__ %1.
# Print the instance variables of self.
alias ps pi self
# Print the locals.
alias pl p_ locals() local:
# print globals
alias pg p_ globals() global:
# Next and list, and step and list.
alias nl n;;l
alias sl s;;l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment