title: How to make a python, command-line program autocomplete arbitrary things NOT interpreter
body: <p>I am aware of how to setup autocompletion of python objects in the python interpreter (on unix).  </p>
  
  <ul>
  <li>Google shows many hits for explanations on how to do this.</li>
  <li>Unfortunately, there are so many references to that it is difficult to find what I need to do, which is slightly different.</li>
  </ul>
  
  <p>I need to know how to enable, tab/auto completion of arbitrary items in a command-line program written in python.</p>
  
  <p>My specific use case is a command-line python program that needs to send emails.  I want to be able to autocomplete email addresses (I have the addresses on disk) when the user types part of it (and optionally presses the TAB key).</p>
  
  <p>I do not need it to work on windows or mac, just linux.</p>