Permalink
Browse files

Python history

  • Loading branch information...
1 parent 8a5c856 commit 4afcbf807db1836d6e4b33f180f3a5026d8d3677 @mjschultz committed Aug 21, 2012
Showing with 36 additions and 0 deletions.
  1. +2 −0 python/config.bash
  2. +3 −0 python/pyhistory
  3. +27 −0 python/pystartup
  4. +1 −0 readline/inputrc.symlink
  5. +3 −0 ssh/ssh.symlink/known_hosts
View
@@ -0,0 +1,2 @@
+export PYTHONSTARTUP="$HOME/.dotfiles/python/pystartup"
+export PYTHONHISTORY="$HOME/.dotfiles/python/pyhistory"
View
@@ -0,0 +1,3 @@
+help()
+quit
+import argparse
View
@@ -0,0 +1,27 @@
+# Add auto-completion and a stored history file of commands to your Python
+# interactive interpreter. Requires Python 2.0+, readline. Autocomplete is
+# bound to the Esc key by default (you can change it - see readline docs).
+#
+# Store the file in ~/.pystartup, and set an environment variable to point
+# to it: "export PYTHONSTARTUP=~/.pystartup" in bash.
+
+import atexit
+import os
+import readline
+import rlcompleter
+
+try :
+ hist_path = os.environ['PYTHONHISTORY']
+except :
+ hist_path = os.path.expanduser("~/.pyhistory")
+
+def save_history(hist_path=hist_path):
+ import readline
+ readline.write_history_file(hist_path)
+
+if os.path.exists(hist_path):
+ readline.read_history_file(hist_path)
+
+atexit.register(save_history)
+del os, atexit, readline, rlcompleter, save_history, hist_path
+
View
@@ -14,3 +14,6 @@ ssh.seas.wustl.edu,128.252.202.128 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAmGdzmbp2c
xinu.mscs.mu.edu,mulug.mscs.mu.edu,acm.mscs.mu.edu,134.48.7.5 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAuXOXm90xzo91BGE280XEUhEZQooKqRTiLigYa4zC+a7tQ4Hf6Vs2KGtK+KGs/aXJlkhiBrNIsV7PYgAGUagnxSNRnrK0/FGOkzx8v/BL22yKbma3I7Hw3QMyRRtPyS+W1evf7o2ufpMWPF6HaghZ8w3hkZqTVDdvWO5P42uHliLPEDD/w8kuIwJA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q6FIQqK6tiGXAO4QarEcbRwqjVaorCSCqWAsn73IyNjKck+7n4JdXGJjAyXR4hUI4SAEFvpMI2N6/nYYXzoFa/M=
+pna.nts.wustl.edu,128.252.1.193 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAtUGNvTgUcQ+e4XuK/HwnGtR4EENVyd5X1xsmXWLEFrWTu2pl04bhu8MwkkO+xNGE6OZWVkccJbhP3jO00D5gqYqakxfz/t9TfwK/lTH0ahtVM6rKZkoVZ/auiWoTAOIkXfPt6G5ZHLkP6dSy02AF66SbhwoNjvtl3JQfSETxRc+IyrVE1QkuFOg3HFtn1cfP9galqI9gtY/nWtnYe5+SHptBuVRd3wKUVCDy6AUcB7x/nOJK3sEDXPQI+TdubKu1zJdmUW6v/E9leUS2lDAp7fnYj8uVoW95RpUALkTHcVVGrkpTTYKT5r9vaYTIzuAUXfmVt+Rjk+M9AsniwGr/mQ==
+128.252.1.196 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAtoHBEmGzcjkLaYVkQJQaE494uthkGcvPk8ZeNgncz4/3JNXLSdbolu9ZfJWc5ptJunDTAx6Om7sMObnDjrPcT5BsHls5dIwCSr5q0Rtn1OsZwt2SjSL9bZt8CcX6Fjm7h8MVyh5j59ODM1O3X0Jgd6t3NYK5bzzBxPoDf9dgmIYnLbQ4e3HAQKmrhYUZTc3WqcsXVK1IyoiOyG9p6AvJ311pxEEg85T2KNwRU5MH8FNiX9IEwtr5ASNXcvwUzrpxFpuv0qrCvOzQFxWBg6n02mwFaZERQh7IM0kOhKq/RJUPi2/jzcP44P/+SJSoE+yVz37Ky3QdiCeoNmMrGYvRjw==

0 comments on commit 4afcbf8

Please sign in to comment.