mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Work a bit more on tkinter demos.
This commit is contained in:
parent
19208900f4
commit
f19ff1ea7d
9 changed files with 99 additions and 90 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue