I have a terminal emulator on my phone (termux to be exact) and i made a python script that formats my contacts into a list of tuples, where the first tuple element is the contact name, and the second is the phone number. I want to print the phone number of a contact by typing in the name. This is easy to do, but then i realised that you need to know and type the entire contact name, which can be long. Terminals have this nice feature: tab completion, and i am curious if i can use it a bit differently than intended.
Can i make it that, after the list has ben built, i can ask the user to type in the contact name, and then when he starts typing the name and presses TAB for the script to auto-complete or list out possible names (like in bash for programs)?