{"id":6030,"library":"pick","title":"Pick","description":"Pick is a small Python library that simplifies creating interactive selection lists in the terminal. It provides a straightforward API for single and multi-select menus, making it easy to build command-line interfaces. The library is currently at version 2.6.0 and maintains an active, though not rapid, release cadence.","status":"active","version":"2.6.0","language":"en","source_language":"en","source_url":"https://github.com/aisk/pick","tags":["terminal","cli","interactive","selection","menu","gui"],"install":[{"cmd":"pip install pick","lang":"bash","label":"Standard installation"},{"cmd":"pip install \"pick[blessed]\"","lang":"bash","label":"Installation with optional Blessed backend"}],"dependencies":[{"reason":"Optional dependency for an alternative terminal rendering backend, used by 'pick[blessed]'.","package":"blessed","optional":true}],"imports":[{"symbol":"pick","correct":"from pick import pick"}],"quickstart":{"code":"from pick import pick\n\n# Single selection example\ntitle = 'Please choose your favorite programming language: '\noptions = ['Python', 'JavaScript', 'C/C++', 'Java', 'Rust']\nselected, index = pick(options, title)\nprint(f\"You picked {selected} at index {index}\")\n\n# Multi-selection example\ntitle_multiselect = 'Please choose all languages you like (press SPACE to select, ENTER to finish): '\nmin_selection = 1 # User must select at least 1 item\nselected_multi, indices_multi = pick(options, title_multiselect, multiselect=True, min_selection_count=min_selection)\nprint(f\"You picked {selected_multi} at indices {indices_multi}\")","lang":"python","description":"This quickstart demonstrates both single and multi-selection using the `pick` function. For multi-selection, users can navigate with arrow keys, select/deselect with SPACE, and finalize their choices with ENTER. The `min_selection_count` ensures a minimum number of items are selected before proceeding."},"warnings":[{"fix":"Install with `pip install \"pick[blessed]\"` and then pass `backend='blessed'` to the `pick` function, e.g., `pick(options, title, backend='blessed')`.","message":"The default backend for `pick` is `curses`, which is primarily designed for Unix-like systems. On Windows, `curses` is not available by default and can lead to `ModuleNotFoundError` or `AttributeError`. For cross-platform compatibility, especially on Windows, consider installing `blessed` and specifying it as the backend.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure clear instructions are provided to the user, or set `min_selection_count=0` if no minimum is strictly required, allowing them to proceed with no selections.","message":"When using `multiselect=True` with `min_selection_count`, the user cannot exit the selection menu by pressing ENTER until they have selected at least the specified minimum number of items. This can be confusing if the user attempts to complete the selection prematurely.","severity":"gotcha","affected_versions":"All versions with multiselect feature"},{"fix":"Test your `pick` application on target environments. Using the `blessed` backend (if compatible with your needs) or ensuring the user's `TERM` environment variable is correctly set can sometimes alleviate compatibility problems.","message":"As `pick` relies on terminal capabilities, display issues or unexpected behavior can occur across different terminal emulators or operating systems, particularly with the default `curses` backend. Font rendering, color support, and keybindings can vary.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z"}