diff options
Diffstat (limited to 'Demo/tkinter/guido/wish.py')
-rw-r--r-- | Demo/tkinter/guido/wish.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Demo/tkinter/guido/wish.py b/Demo/tkinter/guido/wish.py index bebab1e5e38..332501d82c0 100644 --- a/Demo/tkinter/guido/wish.py +++ b/Demo/tkinter/guido/wish.py @@ -4,21 +4,25 @@ import _tkinter import os import sys -tk = _tkinter.create(os.environ['DISPLAY'], 'wish', 'Tk', 1) +tk = _tkinter.create(os.environ['DISPLAY'], 'wish', 'Tk', 1, 1) tk.call('update') cmd = '' -while 1: - if cmd: prompt = '' - else: prompt = '% ' +while True: + if cmd: + prompt = '' + else: + prompt = '% ' try: sys.stdout.write(prompt) sys.stdout.flush() line = sys.stdin.readline() + if not line: + break except EOFError: break - cmd = cmd + (line + '\n') + cmd += line if tk.getboolean(tk.call('info', 'complete', cmd)): tk.record(line) try: |