Don't reference removed files in Makefile
[python/dscho.git] / Demo / tkinter / guido / wish.py
blob5cbb1b90c221b396eaa2e34f27b7a080af85bf7b
1 # This is about all it requires to write a wish shell in Python!
3 import tkinter
5 tk = tkinter.create(':0', 'wish', 'Tk', 1)
6 tk.call('update')
8 cmd = ''
10 while 1:
11 if cmd: prompt = ''
12 else: prompt = '% '
13 try:
14 line = raw_input(prompt)
15 except EOFError:
16 break
17 cmd = cmd + (line + '\n')
18 if tk.getboolean(tk.call('info', 'complete', cmd)):
19 tk.record(line)
20 try:
21 result = tk.call('eval', cmd)
22 except tkinter.TclError, msg:
23 print 'TclError:', msg
24 else:
25 if result: print result
26 cmd = ''