⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wish.py

📁 reduced python source for embedded apps
💻 PY
字号:
# This is about all it requires to write a wish shell in Python!import _tkinterimport ostk = _tkinter.create(os.environ['DISPLAY'], 'wish', 'Tk', 1)tk.call('update')cmd = ''while 1:	if cmd: prompt = ''	else: prompt = '% '	try:		line = raw_input(prompt)	except EOFError:		break	cmd = cmd + (line + '\n')	if tk.getboolean(tk.call('info', 'complete', cmd)):		tk.record(line)		try:			result = tk.call('eval', cmd)		except _tkinter.TclError, msg:			print 'TclError:', msg		else:			if result: print result		cmd = ''

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -