Fill as-you-type on command line with python

I would like to write a small application / directory / file launcher application in python. To do this quickly, I would like autocomplete / autostart entries. But I want to display these sentences as user types. From what I read about the completion of the readline module, it is only possible with the help of the "Hotkey for completion", for example. Tab.

Any suggestions?

Using filter curses, as suggested below, doesn't seem to work. This minimal example clears my screen despite calling filter ():

import curses curses.filter() win = curses.initscr() curses.noecho() curses.cbreak() while 1: key = win.getkey() win.echochar(key) if key == "Q": break curses.endwin() 
+4
source share
1 answer

I would try with the "curses" library:

http://docs.python.org/2/library/curses.html

You have a related topic at:

How to make python autocomplete mapping match?

+1
source

Source: https://habr.com/ru/post/1497762/


All Articles