Advertisement
metalx1000

Tab Completion in Python

Aug 12th, 2017
645
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. #enable auto tab completion in Python
  2. Create a file .pythonrc
  3.  
  4. # ~/.pythonrc
  5. # enable syntax completion
  6. try:
  7.     import readline
  8. except ImportError:
  9.     print("Module readline not available.")
  10. else:
  11.     import rlcompleter
  12.     readline.parse_and_bind("tab: complete")
  13. then in your .bashrc file, add
  14.  
  15. export PYTHONSTARTUP=~/.pythonrc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement