Skip to content

Instantly share code, notes, and snippets.

@mertsalik
Last active February 6, 2018 11:22
Show Gist options
  • Save mertsalik/f842109286a44a61087e92fef51aa600 to your computer and use it in GitHub Desktop.
Save mertsalik/f842109286a44a61087e92fef51aa600 to your computer and use it in GitHub Desktop.
Interactive Python in Shell
See: https://stackoverflow.com/a/246779/930899
I may have found a way to do it.
Create a file .pythonrc
# ~/.pythonrc
# enable syntax completion
try:
import readline
except ImportError:
print("Module readline not available.")
else:
import rlcompleter
readline.parse_and_bind("tab: complete")
then in your .bashrc file, add
export PYTHONSTARTUP=~/.pythonrc
That seems to work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment