diff options
author | Jeff Quast <contact@jeffquast.com> | 2015-09-18 12:38:58 -0700 |
---|---|---|
committer | Jeff Quast <contact@jeffquast.com> | 2015-09-18 12:38:58 -0700 |
commit | faff3e605b2e1d6d30d3f9ded95473ccfbb8daf0 (patch) | |
tree | 9d0347210f6b2fc31b1b330b2ba27dd24eb7c90a /tests/getch.py | |
parent | cde8e15893edd87c61acf0515fd217554d21ce51 (diff) | |
download | pexpect-git-faff3e605b2e1d6d30d3f9ded95473ccfbb8daf0.tar.gz |
Allow {p}.interact(escape_character=None)
For those who wish to disable the ability to escape using
escape_character until normal process termination, they
may now set the value of escape_character to None.
Some of the related docstring on escape_character was made more
brief and clear about its related value behavior.
This closes #131 #132 #167
Diffstat (limited to 'tests/getch.py')
-rwxr-xr-x | tests/getch.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/getch.py b/tests/getch.py index 41e3224..7175e33 100755 --- a/tests/getch.py +++ b/tests/getch.py @@ -18,6 +18,7 @@ PEXPECT LICENSE OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ''' +from __future__ import print_function import sys, tty, termios if hasattr(sys.stdin, 'buffer'): @@ -27,13 +28,13 @@ else: stdin = sys.stdin def main(): - print('READY') + print('READY', end='\r\n') while True: try: val = ord(stdin.read(1)) except KeyboardInterrupt: val = 3 - sys.stdout.write('%d<STOP>\r\n' % (val,)) + print('%d<STOP>' % (val,), end='\r\n') if val == 0: # StopIteration equivalent is ctrl+' ' (\x00, NUL) break |