diff options
author | Jonathan Slenders <jonathan@slenders.be> | 2016-12-17 12:28:17 +0100 |
---|---|---|
committer | Jonathan Slenders <jonathan@slenders.be> | 2016-12-17 12:28:17 +0100 |
commit | cab38aa641af23489d87e87cf0d2661ec417d4a1 (patch) | |
tree | 20df87e634ef02031350ef9acfb9652360ade173 | |
parent | ae9533584ad62bce8543aebb7f9c9089bcd7c6d2 (diff) |
Added operate-and-get-next.py example.
-rwxr-xr-x | examples/operate-and-get-next.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/examples/operate-and-get-next.py b/examples/operate-and-get-next.py new file mode 100755 index 00000000..4386819b --- /dev/null +++ b/examples/operate-and-get-next.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python +""" +Demo of "operate-and-get-next". + +(Actually, this creates one prompt application, and keeps running the same app +over and over again. -- For now, this is the only way to get this working.) +""" +from __future__ import unicode_literals +from prompt_toolkit.shortcuts import create_prompt_application, run_application + + +def main(): + app = create_prompt_application('prompt> ') + while True: + run_application(app) + + +if __name__ == '__main__': + main() |