root = Tk()
termf = Frame(root, height=400, width=500)
termf.pack(fill=BOTH, expand=YES)
wid = termf.winfo_id()
os.system('xterm -into %d -geometry 40x20 -sb &' % wid)
How to embed a terminal in a Tkinter application?