summaryrefslogtreecommitdiff
path: root/lib/pythonrc
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2020-04-16 21:30:51 -0700
committerBen Sima <ben@bsima.me>2020-04-16 21:30:51 -0700
commit8c92bc399732c02721ed5432815b95c818e1b90b (patch)
treeafc2d4849dc9fc70f9a328ad263fc0487874714a /lib/pythonrc
parentdb05fc6f13b9bb87b0c965e393d369ffa677bcd7 (diff)
Add python startup files
Diffstat (limited to 'lib/pythonrc')
-rw-r--r--lib/pythonrc15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/pythonrc b/lib/pythonrc
new file mode 100644
index 0000000..ec59d2b
--- /dev/null
+++ b/lib/pythonrc
@@ -0,0 +1,15 @@
+import os
+import pdb
+import pprint
+import rlcompleter, readline
+import sys
+
+# enable tab completion
+readline.parse_and_bind("tab: complete")
+
+# also get tab completion in pdb
+pdb.Pdb.complete = rlcompleter.Completer(locals()).complete
+
+# prettyprint with p()
+pp = pprint.PrettyPrinter(indent=4, width=80)
+p = pp.pprint