2

I'm writing a CLI app and there is a place, where user should to write path to using dir. Of couse, I can read it with raw_input(), but standart Completer can't autocomplete path by TAB. So is there any solution in python (or somewhere else) or should I to write my own Completer?

Ximik
  • 2,435
  • 3
  • 27
  • 53

1 Answers1

0

Have a look at this SO question, the readline module, and readline.clear_history() / readline.add_history().

Community
  • 1
  • 1
chryss
  • 7,459
  • 37
  • 46
  • Yes, I can write function and make this with readline. But I hoped, that there is python module. Whatever thank for the anwer. – Ximik Aug 07 '10 at 20:22
  • 1
    @Ximik: chryss actually meant the python readline module [here](http://docs.python.org/library/readline.html). – Muhammad Alkarouri Aug 07 '10 at 21:13
  • Thanks, Muhammad, I did indeed. Added the link to make it easier to spot. – chryss Aug 07 '10 at 21:18
  • @Muhammad Alkarour I understood, but default realization of Completer in this module doesn't support completion of the paths. In fact, this is my problem. But ok, seems like I have to write my own completer for readline. – Ximik Aug 07 '10 at 22:10