pythonstartup.py
2Improve the Python REPL.
4Inspired by this tweet by @nedbat:
5https://twitter.com/nedbat/status/817827164443840512
9* Use pprint() by default.
10 https://gist.github.com/chekunkov/848c3472d4b0bee69bccd2e77907a590
12 https://github.com/patrik-johansson/dotfiles/blob/master/.pythonstartup
21def displayhook_pprint(o):
22 """Display hook powered by pprint.
23 https://www.python.org/dev/peps/pep-0217/
27 if sys.version_info[0] == 2:
28 import __builtin__ as builtins
31 # Set '_' to None to avoid recursion
32 # https://docs.python.org/3/library/sys.html#sys.displayhook
38sys.displayhook = displayhook_pprint
40readline.parse_and_bind("tab: complete")