Jun-08-2020, 12:10 AM
Ok this is too complicated for my current level i'm afraid.
I compermised on just reading from the complete .txt file that contains the output
and display it in the text widget when its done but I got lost trying to refresh with the after() func.
what it does is actually freeze the textbox (and the program) for the amount of ms I set...
how can I make the text window read the file after every time I click submit?
I compermised on just reading from the complete .txt file that contains the output
and display it in the text widget when its done but I got lost trying to refresh with the after() func.
what it does is actually freeze the textbox (and the program) for the amount of ms I set...
how can I make the text window read the file after every time I click submit?
self.text_widget() def text_widget(self): self.text_file = open(fr'c:/users/{os.getlogin()}/Desktop/default.txt', 'w+').read() self.text_window = tk.Text(self, height=100, width=500, bg="gray", wrap=tk.WORD) self.text_window.update() self.text_window.grid(row=7, column=1, rowspan=3, sticky="we") self.text_window.insert(tk.END, self.read_file) self.text_window.after(5000, self.read_file) def read_file(self): self.text_file = open(fr'c:/users/{os.getlogin()}/Desktop/default.txt', 'w+').read() self.text_window.insert(tk.END, self.text_file)