A note on using tab completion when running Python interactively on Windows

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.

Install "py readline" instead of "readline".

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

A note on using tab completion when running Python interactively on Windows
Trap trapped when running a Python Windows executable
[GCP] A memorandum when running a Python program on Cloud Functions
A note when I can't open Jupyter Notebook on Windows
A note of what I learned when I thought about using pyenv or virtualenv on Windows
Things to note when running Python on EC2 from AWS Lambda
Everything from building a Python environment to running it on Windows
Notes for using OpenCV on Windows10 Python 3.8.3.
Creating a python virtual environment on Windows
A useful note when using Python for the first time in a while
Python on Windows
A memo when using systemd to keep a Python script running as a daemon on CentOS 7 at all times.
A memo of a tutorial on running python on heroku
A addictive story when using tensorflow on Android
Simply build a Python 3 execution environment on Windows
Notes on installing Python3 and using pip on Windows7
A note on optimizing blackbox functions in Python
Note on encoding when LANG = C in Python
Python Note: When assigning a value to a string
[Note] Installing Python 3.6 + α on Windows and RHEL
Create a Python virtual development environment on Windows
A note I was addicted to when running Python with Visual Studio Code
[Grasshopper] When creating a data tree on Python script
Build a GVim-based Python development environment on Windows 10 (3) GVim8.0 & Python3.6
[Heroku] Memo for deploying Python apps using Heroku on Windows [Python]
A note on the library implementation that explores hyperparameters using Bayesian optimization in Python
Until drawing a 3D graph in Python on windows10
Create a comfortable Python 3 (Anaconda) development environment on windows
Build a GVim-based Python development environment on Windows 10 (1) Installation
Check types_map when using mimetypes on AWS Lambda (Python)
Things to note when initializing a list in Python
What's in that variable (when running a Python script)
SoC FPGA: A small story when using on Linux
python basic on windows ②
Build a Python environment on your Mac using pyenv
Procedure for building a CDK environment on Windows (Python)
Troublesome story when using Python3 with VScode on ubuntu
A note on handling variables in Python recursive functions
[Python] I tried running a local server using flask
A note on speeding up Python code with Numba
Create a decent shell and python environment on Windows
A swampy story when using firebase on AWS lamda
A little trick to know when writing a Twilio application using Python on AWS Lambda
Minimum memo when using Python on Mac (pyenv edition)
Minimum notes when using Python on Mac (Homebrew edition)
I got "ModuleNotFoundError: No module named'azure'" when running a program using Azure SDK for Python
Building a Python environment on a Mac and using Jupyter lab
A solution when you can't start project Django on Windows
[python] A note when trying to use numpy with Cython
How to transpose a 2D array using only python [Note]
A note on touching Microsoft's face recognition API in Python
[Treasure Data] [Python] Execute a query on Treasure Data using TD Client
Build a GVim-based Python development environment on Windows 10 (2) Basic settings
Python environment construction procedure memo using Docker on Windows10 Home
Note links that may be useful when using Python, Selenium2
Try running a function written in Python using Fn Project
When you want to hit a UNIX command on Python
Until building a Python development environment using pyenv on Ubuntu 20.04
Set-enable Python virtualenv on Windows
Run Openpose on Python (Windows)
Install watchdog on Windows + Python 3.3