Python library to build pretty command line user prompts with interactive forms and validation
Overall
score
96%
Build a command-line tool that helps users search and select cities from a database using an interactive autocomplete prompt.
Create a Python script named city_search.py that:
City Database: Maintains a list of at least 15 cities with their countries.
Interactive Autocomplete Prompt: Presents an interactive prompt with the question "Search for a city:" that provides autocomplete suggestions as the user types. The autocomplete should:
Display Selection: After the user selects a city, print: You selected: {city}, {country}
Handle Cancellation: If the user cancels the prompt, print: Search cancelled.
Your database should include at least these cities (you may add more):
When the user runs the script, they should see an autocomplete prompt. As they type, matching cities should appear in a dropdown. After selecting a city, they should see a confirmation like:
You selected: Paris, FranceProvides interactive command-line prompts with autocomplete functionality.
@generates
Install with Tessl CLI
npx tessl i tessl/pypi-questionarydocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10