I'm making an ide using tkinter and i have to create a terminal for it and I found a method to give output and get output to cmd but when i try to insert it's output to terminal that is text widget than my program is not responding and I have to close my program here is my some piece of code please help!
import os
from tkinter import *
def ts():
    a = float(t.index('end-1c linestart')) -1
    b = t.get(a,END)
    for i in os.popen(b,"r"): 
        break
root = Tk()
t = Text()
t.pack()
Button(command=ts,text="dsfdsfd").pack()
root.mainloop()
 
    