(很短)tinkter 创建一个text文本框,并传入数值进行显示,之后将其删除
from tkinter import *class GUI(Entry):
def delete_text(self):#删除文本框内容
self.text.delete(1.0, 'end')
def create_text(self,array):
root = Tk()
self.text = Text(root)
self.text.place(width=150, height=150)# width:长度;height:高度
self.text.insert("insert", array)
root.mainloop()
if __name__ == '__main__':
array =
frame = GUI()
frame.create_text(array)
frame.delete_text()from tkinter import *
class GUI(Entry):
def delete_text(self):#删除文本框内容
self.text.delete(1.0, 'end')
def create_text(self,array):
root = Tk()
self.text = Text(root)
self.text.place(width=150, height=150)# width:长度;height:高度
self.text.insert("insert", array)
root.mainloop()
if __name__ == '__main__':
array =
frame = GUI()
frame.create_text(array)
frame.delete_text() text怎么才能显示一次换一行
页:
[1]