Maybe something like that: https://stackoverflow.com/questions/7821661/how-to-code-autocompletion-in-python