Aug-08-2021, 07:26 PM
Hello
At the beginning I want show you what I want achieve.
I using tkinter: 2 text field and 1 button:
in the first text field I enter:
one
two
three
I press the button
The second field should show:
a:one
a:two
a:three
but unfortunately it appears:
a:one
two
three
it is my code:
At the beginning I want show you what I want achieve.
I using tkinter: 2 text field and 1 button:
in the first text field I enter:
one
two
three
I press the button
The second field should show:
a:one
a:two
a:three
but unfortunately it appears:
a:one
two
three
it is my code:
import tkinter as tk from tkinter import * def OpenWindow(): root = tk.Tk() root.geometry('400x250') return root root = OpenWindow() text1 = Text(root, width='12', height='10') text1.place(x=20,y=20) text2 = Text(root, width="12", height="10") text2.place(x=240,y=20) def click(): text_input = text1.get("1.0", END) text2.delete(1.0, END) for i in text_input: row_word = ('a:' + text_input) text2.insert(1.0, row_word) button_click = Button(root, text='add', command=click) button_click.pack() root.mainloop()Thank you for help, I beginning my adventure with Python so maybe my question is tryvial...