Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
127 views
in Technique[技术] by (71.8m points)

python - How to create a multiline entry with tkinter?

Entry widgets seem only to deal with single line text. I need a multiline entry field to type in email messages.

Anyone has any idea how to do that?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You could use the Text widget:

from tkinter import *

root = Tk()
text = Text(root)
text.pack()
root.mainloop()

Or with scrolling bars using ScrolledText:

from tkinter import *
from tkinter.scrolledtext import ScrolledText

root = Tk()
ScrolledText(root).pack()
root.mainloop()

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...