Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@blacknon
Last active January 30, 2023 02:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blacknon/4327d2c3f91537be01a06b739ac4e319 to your computer and use it in GitHub Desktop.
Save blacknon/4327d2c3f91537be01a06b739ac4e319 to your computer and use it in GitHub Desktop.
python_prompt_toolkitの動作検証用のスクリプト
#!/usr/bin/env python3
# -*- encoding: UTF-8 -*-
from prompt_toolkit import prompt
from prompt_toolkit.completion import FuzzyWordCompleter
# 単語の候補
my_completer = FuzzyWordCompleter(
["apple", "goole", "japan", "hoge", "hello world", "good morning"]
)
while 1:
# hisotoryで履歴を追加
user_input = prompt("> ", completer=my_completer)
print(user_input)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment