Я искал помощи, но не смог найти то, что мне нужно ... У меня есть что-то похожее на это:
![enter image description here](https://i.stack.imgur.com/PzUdb.jpg)
Так что, когда пользователь вводит ингредиенты, он получает рецепты онлайн. Здесь я хочу исправить текстовое поле, поскольку оно показывает только одну строку. Когда я распечатываю вывод, он включает новую строку и выглядит лучше, но как только я вставляю это в поле ввода, он игнорирует все новые строки и пробелы. Это мой код для интерфейса:
# Driver code
if __name__ == "__main__":
# create a GUI window
master = tk.Tk()
s = tk.StringVar()
field1 = tk.Entry(master, textvariable=s)
field1.config({"background": "LightBlue1", "disabledbackground": "LightSkyBlue1"})
field2 = tk.Entry(master)
field2.config({"background": "Ivory", "disabledbackground": "Ivory"})
field1.place(x=20, y=20, width=660, height=40)
field2.place(x=20, y=80, width=660, height=500)
field1.configure(state='disabled')
field2.configure(state='disabled')
# set font
myFont = font.Font(family='Verdana', size=9, weight='bold')
# set text message for cavas
text = "Welcome to Recipe Finder!\n" \
+ "Instruction: Click the colored button,\n" \
+ "Type either sentence or words\n" \
+ "into the light blue box."
canvas = tk.Canvas(master, width=250, height=100, bg='DodgerBlue4')
canvas.pack()
canvas.place(x=700, y=40)
canvas.create_text(125, 50, fill="white", font=myFont, text=text)
# set the background colour of GUI window
master.configure(background="lemon chiffon")
# set the title of GUI window
master.title("Recipe Finder")
# set the configuration of GUI window
master.geometry("970x600")
# Buttons
button1 = tk.Button(master, text=' Click for some food jokes! ', fg='black', bg='salmon',
command=foodJokes, height=5, width=30)
button1.place(x=700, y=200)
button1['font'] = myFont
button2 = tk.Button(master, text=' Type the ingredients you have! ', fg='black', bg='orange',
command=askForIngredients, height=5, width=30)
button2.place(x=700, y=300)
button2['font'] = myFont
Clear = tk.Button(master, text=' CLEAR ', fg='black', bg='white',
command=clear, height=5, width=30)
Clear.place(x=700, y=400)
Clear['font'] = myFont
Enter = tk.Button(master, text=' ENTER ', fg='black', bg='white',
command=enter, height=5, width=30)
Enter.place(x=700, y=500)
Enter['font'] = myFont
Хотя мне сказали, что использование "сетки" намного проще и лучше, я обнаружил, что "место" работает лучше для меня ... И я видел только сообщения используя сетку и пакет, который я не хочу менять все мои настройки на данный момент. Есть ли простой способ изменить текст ввода, чтобы обернуть текст внутри поля?