Last active
January 30, 2023 02:45
-
-
Save blacknon/4327d2c3f91537be01a06b739ac4e319 to your computer and use it in GitHub Desktop.
python_prompt_toolkitの動作検証用のスクリプト
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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