Last active
August 29, 2015 13:56
-
-
Save python-consulting/9227275 to your computer and use it in GitHub Desktop.
Enable interactive python auto completion on any platform
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import sys | |
if sys.platform.startswith('linux'): | |
try: | |
import readline | |
except ImportError: | |
print "Module readline not available." | |
else: | |
import rlcompleter | |
readline.parse_and_bind("tab: complete") | |
elif sys.platform.startswith('darwin'): | |
import readline | |
import rlcompleter | |
readline.parse_and_bind("bind ^I rl_complete") | |
elif sys.platform.startswith('win32'): | |
try: | |
import readline | |
except ImportError: | |
print "Install pyreadline package" | |
import rlcompleter | |
readline.parse_and_bind("tab: complete") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment