4

I would like to write a small application/directory/file launcher in python. To make it fast i would like to autocomplete/autosuggest entries. But i want to display these suggestions as the user types. From what i have read about the readline module completion is only possible using a "Completion hotkey" e.g. Tab.

Any suggestions ?

Using curses with filter as suggested below does not seem to work. This minimal example clears my screen despite the call to 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

1 回答 1

1

我会尝试使用“curses”库:

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

您在以下位置有一个相关主题:

如何使python自动完成显示匹配?

于 2013-08-19T10:23:54.880 回答