首页 > 编程语言 > 详细

Python GUI编程(Tkinter)Text控件

时间:2020-02-20 12:24:39      阅读:46      评论:0      收藏:0      [点我收藏+]
import tkinter

#创建主窗口
win = tkinter.Tk()
#设置标题
win.title("sunck")
#设置大小和位置
win.geometry("400x400+200+20")

‘‘‘
文本控件,用于显示多行文本
‘‘‘

#height显示的行数
text = tkinter.Text(win, width=30, height=4)
text.pack()
str = ‘‘‘If there is anyone out there who still doubts that America is a place where all things are possible, who still wonders if the dream of our founders is alive in our time, who still questions the power of our democracy, tonight is your answer‘‘‘
text.insert(tkinter.INSERT, str)

win.mainloop()

Python GUI编程(Tkinter)Text控件

原文:https://www.cnblogs.com/pygo/p/12334564.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!