Skip to content

Instantly share code, notes, and snippets.

@bar
Last active April 17, 2020 06:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bar/3e573166aeb5a12d7dc4 to your computer and use it in GitHub Desktop.
Save bar/3e573166aeb5a12d7dc4 to your computer and use it in GitHub Desktop.
# Print a dictionary, sorted. %1 is the dict, %2 is the prefix for the names.
alias p_ for __k, __v in sorted(%1.items()): print("{}{:<15}= {!r:<80.80}".format("%2", __k, __v))
# Print the member variables of a thing.
alias pi p_ %1.__dict__ %1.
# Print the member variables of self.
alias ps pi self
# Print the locals.
alias pl p_ locals() local:
# Print the globals.
alias pg p_ globals() global:
# Next and list, and step and list.
alias nl n;;l
alias sl s;;l
# Force kill debugger
import os as __os
#alias kk __os._exit(0)
alias kk __os.kill(__os.getpid(), 9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment