Man I must thank you!
you made me break my head with that listener thread and now I got it working!! (still shocked about it lol)
I gave up on trying to read the std and just merged the files into one and did some re-design.
now I got 3 threads running with 1 communicating with the widget.
here it is:
Thanks again!
you made me break my head with that listener thread and now I got it working!! (still shocked about it lol)
I gave up on trying to read the std and just merged the files into one and did some re-design.
now I got 3 threads running with 1 communicating with the widget.
here it is:
def thread_handler(self, host): wt = threading.Thread(target=self.write_to_file, args=(host,)) pt = threading.Thread(target=self.print_to_box, args=(host,)) dt = threading.Thread(target=self.delete_default_lines, args=()) wt.start() pt.start() dt.start()also, I started the entire GUI with a thread and kept it alive:
if __name__ == "__main__": lock = threading.Lock() lock.acquire() t = threading.Thread(name="Main GUI", target=main, args=()) t.start()and this is the widget update:
def print_to_box(self, host): print(f'Current Proccess: {mp.current_process().name} + {mp.current_process().pid}\n') with sub.Popen(["ping", "-n", '4', f'{host}'], stdout=sub.PIPE, bufsize=1, universal_newlines=True, stderr=sub.STDOUT) as p: for line in p.stdout: self.text_window.insert(tk.END, line)that did the entire trick.
Thanks again!