title: python tab completion in windows
body: <p>I'm writing a cross-platform shell like program in python and I'd like to add custom tab-completion actions. On Unix systems I can use the built-in readline module and use code like the following to specify a list of possible completions when I hit the TAB key:</p>
  
  <pre><code>import readline
  readline.parse_and_bind( 'tab: complete' )
  readline.set_completer( ... )
  </code></pre>
  
  <p>How can I do this on Windows? I'd like to avoid relying on 3rd-party packages if possible. If no solution exists is it possible to simply trap TAB key press so that I can implement my own from scratch?</p>