马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
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 = [1,2,3,4]
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 = [1,2,3,4]
frame = GUI()
frame.create_text(array)
frame.delete_text()
|