I have a python3 code below:
import multiprocessing as pr
from multiprocessing.managers import BaseManager
import tkinter as tk
def func(root):
root.mainloop()
BaseManager.register('Tk', tk.Tk)
manager = BaseManager()
manager.start()
inst = manager.Tk()
# print('dd',inst)
process = pr.Process(target=func,args=[inst])
process.start()
process.join()
In the above code, I have created a shared Tk object and I invoked its mainloop method from another process. But it's not working.
It should create a window. What wrong is going on?
I need help !!!