Home>

How to create a large text input field in tkinter?

For example:

import tkinter as tk
window= tk.Tk()
e= tk.Entry(window) # But there is only 1 line!!!
e.pack() # But there is only 1 line!!!
window.mainloop()

How to make a multiline text field in tkinter and get input text from it?

Please elaborate on your specific problem or provide more details on what exactly you need. In its current form, it's hard to understand exactly what you're asking.

Дух сообщества2022-01-22 12:29:17

I made an edit that fixes this. She's on check

FotonPC2022-01-22 12:40:00

Edit successfully checked and accepted

FotonPC2022-01-22 12:44:25
  • Answer # 1

    You can usetkinter.Text.

    For example:

    import tkinter as tk
    window= tk.Tk()
    def get_text(event=None):
        text= text_widjet.get("1.0", END)
        label_text.config(text=text)
    text_widjet= tk.Text(window)
    text_widjet.pack()
    label_text= tk.Label(window)
    label_text.pack()
    Button('Output text in Label', command= get_text).pack()
    window.mainloop()