Overview: Humanity is what you want to use "tab completion" when executing Python interactively (that is, operating from the command line). But for some reason Python on Windows doesn't complement by default. Every time I looked up how to activate it, I stumbled and always gave up, but I solved it, so make a note.
environment: ・ Windows10 ・ Python 3.7.4
In conclusion
C:\Python\python.exe -m pip install pyreadline
I found out that I should insuko "pyreadline" like this.
On the other hand, there is also a package called "readline", which gives an error when inscoing, saying "It doesn't work on Windows". It was a habit to find the theory that "Windows can be done with'readline'Insco" on the net. I was confused here and gave up.
After installing pyreadline You can now safely complete tabs.
In some cases
python
import rlcompleter
rlcompleter.readline.parse_and_bind('tab: complete')
There seems to be information such as "Seyo", but it is unknown whether it is really necessary (* In that case, "rlcompleter" may also be entered with pip)
I couldn't find a nice article in Japanese, so I will leave it as a memo.
Recommended Posts