【发布时间】:2014-11-05 16:57:16
【问题描述】:
from Tkinter import *
root=Tk()
frame1=Frame(root)
frame2=Frame(root)
str=StringVar()
text=Text(frame2,width=5,height=20)
def response():
b=text.get("1.0","END-1c")
str.set(b)
text=Text(frame2,width=5,height=20)
button=Button(frame2,width=3,height=3,text="SEND",command=response)
text.pack(side=LEFT)
button.pack(side=RIGHT)
label=Label(frame1,width=10,height=50,textvariable=str)
label.pack()
frame1.pack(side=TOP,fill=X)
frame2.pack(side=BOTTOM,fill=X)
我在 Gedit 上编写的 Python 代码。当我尝试使用终端命令调用 python 代码时,屏幕上不会出现任何窗口。这可能是什么原因?
【问题讨论】: