How to code autocompletion in python?

前端 未结 6 1785
暖寄归人
暖寄归人 2020-11-27 11:20

I\'d like to code autocompletion in Linux terminal. The code should work as follows.

It has a list of strings (e.g. \"hello, \"hi\", \"how are you\", \"goodbye\", \"

6条回答
  •  时光取名叫无心
    2020-11-27 11:32

    For those (like me) that end up here searching for autocomplete in the interpreter:

    https://web.archive.org/web/20140214003802/http://conjurecode.com/enable-auto-complete-in-python-interpreter/

    This involves creating a file .pythonrc, modifying .bashrc and an import sys you have to import every time you launch the Python interpreter.

    I wonder if the latter can be automated for even more win.

提交回复
热议问题