diff options
Diffstat (limited to 'examples/prompts/custom-lexer.py')
-rwxr-xr-x | examples/prompts/custom-lexer.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/prompts/custom-lexer.py b/examples/prompts/custom-lexer.py index c4c9fbe..75ad2d3 100755 --- a/examples/prompts/custom-lexer.py +++ b/examples/prompts/custom-lexer.py @@ -2,6 +2,7 @@ """ An example of a custom lexer that prints the input text in random colors. """ + from prompt_toolkit.lexers import Lexer from prompt_toolkit.shortcuts import prompt from prompt_toolkit.styles.named_colors import NAMED_COLORS @@ -22,7 +23,7 @@ class RainbowLexer(Lexer): def main(): answer = prompt("Give me some input: ", lexer=RainbowLexer()) - print("You said: %s" % answer) + print(f"You said: {answer}") if __name__ == "__main__": |