summaryrefslogtreecommitdiffstats
path: root/examples/prompts/placeholder-text.py
blob: e1133302801afaeed13eedd7977fb4c057ff5032 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env python
"""
Example of a placeholer that's displayed as long as no input is given.
"""
from prompt_toolkit import prompt
from prompt_toolkit.formatted_text import HTML

if __name__ == "__main__":
    answer = prompt(
        "Give me some input: ",
        placeholder=HTML('<style color="#888888">(please type something)</style>'),
    )
    print("You said: %s" % answer)