The problem is controlling output in 2 VSCode sessions. The Python code is running fine. It is possible that there is a Python solution to the problem, i.e. multiprocessing/threading would solve the problem, but we have no code to work with.
A simple program that sends data to a Tkinter Listbox instead of the shell. Don't know if this will help or not, and you may have to use multiprocessing/threading for each separate program instance, but the listbox code would remain similar to this
A simple program that sends data to a Tkinter Listbox instead of the shell. Don't know if this will help or not, and you may have to use multiprocessing/threading for each separate program instance, but the listbox code would remain similar to this
## program name = test_1.py def update_listbox(listbox, ctr, time_to_sleep): listbox.insert("end", "%s" % (ctr)) listbox.after(time_to_sleep, update_listbox, listbox, ctr+1, time_to_sleep) ## different program import tkinter as tk import multiprocessing import test_1 class CalculateNumbers(): def __init__(self, root): self.root=root tk.Button(self.root, text="Quit", bg="orange", command=self.root.quit, width=7).grid() self.lb_1 = self.create_listbox("lightblue") test_1.update_listbox(self.lb_1, 1, 500) self.lb_2 = self.create_listbox("lightyellow") test_1.update_listbox(self.lb_2, 11, 750) def create_listbox(self, bg_color): top=tk.Toplevel(root) lb = tk.Listbox(top, height=30, width=20, bg=bg_color, font=('Fixed', 14)) lb.grid(row=0, column=0) return lb if __name__ == "__main__": root=tk.Tk() CN=CalculateNumbers(root) root.mainloop()