如下所示:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
import tkinter
win=tkinter.Tk()
text=tkinter.Text(win) #文本编辑器(用于展示数据)
text.insert(tkinter.INSERT, "因为你在我心中是那么的具体" )
text.insert(tkinter.INSERT, "\r\n" ) #换行
text.insert(tkinter.INSERT, "因为你在我心中是那么的具体" )
text.insert(tkinter.INSERT, "\r\n" )
text.insert(tkinter.INSERT, "因为你在我心中是那么的具体" )
text.insert(tkinter.INSERT, "\r\n" )
text.insert(tkinter.INSERT, "因为你在我心中是那么的具体" )
text.insert(tkinter.INSERT, "\r\n" )
text.insert(tkinter.INSERT, "因为你在我心中是那么的具体" )
text.pack()
win.mainloop()
|
以上这篇对Python 窗体(tkinter)文本编辑器(Text)详解就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持服务器之家。
原文链接:https://blog.csdn.net/houyanhua1/article/details/78174242