tessl install tessl/pypi-questionary@2.1.0Python library to build pretty command line user prompts with interactive forms and validation
Agent Success
Agent success rate when using this tile
96%
Improvement
Agent success rate improvement when using this tile compared to baseline
1x
Baseline
Agent success rate without this tile
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