Work a bit more on tkinter demos.

This commit is contained in:
Georg Brandl 2010-10-26 10:39:14 +00:00
parent 19208900f4
commit f19ff1ea7d
9 changed files with 99 additions and 90 deletions

View file

@ -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: