IT/Programming

[Python] CLI 인터프리터 환경 Tab/자동 완성

nofence 2024. 4. 14. 15:47

Windows 환경에서 CLI 기반의 파이썬 인터프리터를 사용할 때 Tab을 이용한 자동 완성 기능이 제공되지 않아 여간 불편하지 않을 수가 없다. 다행히 이를 해결해 주는 라이브러리가 존재하는 걸 이제서야 알게 되었다-.- pyreadline3 라이브러리를 설치 후 Tab을 통해 자동 완성이 가능하다!

 

C:\>python -m pip install pyreadline3
Collecting pyreadline3
  Downloading pyreadline3-3.4.1-py3-none-any.whl.metadata (2.0 kB)
Downloading pyreadline3-3.4.1-py3-none-any.whl (95 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 95.2/95.2 kB 5.3 MB/s eta 0:00:00   
Installing collected packages: pyreadline3
Successfully installed pyreadline3-3.4.1

C:\>python
Python 3.10.0 (tags/v3.10.0:b494f59, Oct  4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import o
or       oct(     ord(     object() open(

 

* 출처

https://stackoverflow.com/questions/46944162/python-console-tab-completion-not-working-in-windows

 

python console tab completion not working in windows

running Windows 10 From what I understand python3 has tab completion in the python console already built in but this isn't working for me. When I hit tab there is no completion: Im aware there are

stackoverflow.com

https://pypi.org/project/pyreadline3/

 

pyreadline3

A python implementation of GNU readline.

pypi.org