from tkinter import *
from tkinter import messagebox
from multiprocessing import Process
import pyautogui
class box(Process):
def __init__(self):
Process.__init__(self)
def run(self):
width, height = pyautogui.size() #모니터 해상도 가져오기
pyautogui.moveTo(width/2,height/2)
class root(Tk):
def __init__(self):
Tk.__init__(self)
self.btn=Button(self,text="push",command=self.btn_pushed,width=10,height=2)
self.btn.pack()
def btn_pushed(self):
box().start()
t=root()
t.mainloop()
목적은 버튼 누르면 box.run()함수가 실행되는 프로그램인데
버튼 누르면 tkinter창이 하나 더 뜸. 그 창을 닫으면 box.run()이 실행됨. 뭐가 문제임?
원래 tkinter랑 멀티프로세싱이랑 궁합이 안맞음?
댓글 0