我试图产生一个"不寻常的"子进程:我的主进程在命令行或嵌入式环境中运行,它生成一个运行Tkinter GUI的新进程。但是这会立即崩溃python(在Mac上为3.6)。
import multiprocessing as mp
import tkinter as TK
def RunGUI():
root = TK.Tk()
root.title('Hello Child GUI')
root.geometry('{}x{}+0+0'.format(768, 768))
root.resizable(width=False, height=False)
root.attributes('-topmost', True)
root.mainloop()
job = []
p = mp.Process(target=RunGUI)
job.append(p)
p.start()
Tkinter是不支持这种使用模式还是我做错了什么?
更新
我收到的错误信息是这样的:
**Python quit unexpectedly**
Click Reopen to open the application again. Click Report to see more detailed information and send a report to Apple.