summaryrefslogtreecommitdiffstats
path: root/examples/prompts/placeholder-text.py
blob: 35e1c6c5c9d2d1f12d7aa19745d592cf9f239f45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env python
"""
Example of a placeholder 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)