8

I just started learning python and am writing my own tab-completion function for practice/fun (so no one tell me to us rlcompleter). I'm having some trouble getting actually get the python to call the function though. My code:

import readline
def tab_completer():
    print readline.get_line_buffer()

readline.parse_and_bind("tab: tab_completer")
while True:
    raw_input("Prompt")

the expected output is that when I hit the tab key it would print what ever I had typed, how ever this is not what is actually happening, any advice?

Trcx
  • 4,164
  • 6
  • 30
  • 30
  • You need to detail what is actually happening. – Ross Patterson Aug 18 '11 at 15:52
  • Nothing happens, something is bound to the tab button (because it no longer tabs), but it doesn't run the function. All that happens is I hear noise like I pressed an invalid key. – Trcx Aug 18 '11 at 17:37

0 Answers0