Я много пытался встроить Python IDLW в мое окно tkinter.Есть ли предопределенный модуль для встраивания в режим ожидания с окном tkinter?
# -*- coding: utf-8 -*-
## Front Homepage
from sklearn import linear_model
import matplotlib.pyplot as plt
from matplotlib import interactive
from login import *
from PIL import ImageTk, Image
import tkinter as tk
import os
from tkinter.ttk import *
##creating window
root = tk.Tk()
## Title bar of front page
program_name="Silk Project : SUPERVISED MODEL"
root.title(program_name)
root.configure(bg = "Pink")
## Menu Bar
menu_bar=Menu(root)
## File menu in menu bar
file_menu=Menu(menu_bar,tearoff=0)
menu_bar.add_cascade(label="File",menu=file_menu,underline=0)
file_menu.add_command(label="New",accelerator="Ctrl+N")
file_menu.add_command(label="Open",accelerator="Ctrl+O")
file_menu.add_command(label="Save",accelerator="Ctrl+S")
file_menu.add_command(label="Save as",accelerator="Shift+Ctrl+S")
file_menu.add_separator()
file_menu.add_command(label="Exit",accelerator="Alt+F4",)
root.config(menu=menu_bar)
## Edit menu in menu bar
Edit_menu=Menu(menu_bar,tearoff=0)
menu_bar.add_cascade(label="Edit",menu=file_menu,underline=0)
Edit_menu.add_command(label="New",accelerator="Ctrl+N")
Edit_menu.add_command(label="Open",accelerator="Ctrl+O")
Edit_menu.add_command(label="Save",accelerator="Ctrl+S")
Edit_menu.add_command(label="Save as",accelerator="Shift+Ctrl+S")
Edit_menu.add_separator()
Edit_menu.add_command(label="Exit",accelerator="Alt+F4",)
root.config(menu=menu_bar)
## Option menu in menu bar
Option_menu=Menu(menu_bar,tearoff=0)
menu_bar.add_cascade(label="Option",menu=file_menu,underline=0)
Option_menu.add_command(label="New",accelerator="Ctrl+N")
Option_menu.add_command(label="Open",accelerator="Ctrl+O")
Option_menu.add_command(label="Save",accelerator="Ctrl+S")
Option_menu.add_command(label="Save as",accelerator="Shift+Ctrl+S")
Option_menu.add_separator()
Option_menu.add_command(label="Exit",accelerator="Alt+F4",)
root.config(menu=menu_bar)
## FrAME A
s = Style()
s.configure('My.TFrame', background='plum1')
frame = Frame(root , style='My.TFrame')
frame.place(height=600, width=250, x=0, y=0)
## FrAME B
s1 = Style()
s1.configure('My2.TFrame', background='White')
frame2 = Frame(root , style='My2.TFrame')
frame2.place(height=590, width=950, x=250, y=15)
##Output Label
var="Output"
label1 = tk.Label(root , borderwidth = 10 , text=var , background="orange")
label1.place(height =15 , width =50 ,x=250,y=0)
## Size of Homepage
root.geometry("1200x600+50+25")
#not minimization and maximization property
root.resizable(0,0)
## Output Window :
from tkinter import *
from subprocess import *
print("Hello world")
def func():
proc = Popen("run.py", stdout=PIPE, stdin=PIPE ,stderr=PIPE , shell=True)
proc = proc.communicate()
output.insert(END, proc)
Check = Button(frame, text="Display output", command=func)
Quit = Button(frame, text="Exit", fg="red", command=root.quit)
output = Text(frame2)
Check.pack()
Quit.pack()
output.place(height=590, width=950, x=0, y=0)
root.iconbitmap(r'C:\Users\Silk\Desktop\SILK\SILK-GUI\5.ico')
root.mainloop()