Hello,
I am experiencing a fundamental problem with Kivy and multi-processing on windows. (1.8.0 / Python 2.7). When I run the code below, i'm seeing an kivy window pop up when the sub-process is created. From my research, it seems to be tied to kivy being referenced before the sub process is created. The example to repro is is simple, listed below:
What can I do to use multiprocessing successfully with kivy?
Thank you very much.
========File mptest.py==============
from time import sleep
import multiprocessing
def the_sub_process():
for x in range(0,10):
print("sub process")
sleep(1)
class Mptest(object):
def __init__(self, **kwargs):
self.start_connection_process()
def start_connection_process(self):
connection_process = multiprocessing.Process(target=the_sub_process)
connection_process.start()
========File main.py==============
#!/usr/bin/python
__version__ = "1.0.0"
from multiprocessing import freeze_support
from mptest import Mptest
if __name__ == '__main__':
freeze_support()
Mptest().start_connection_process()
from kivy.uix.label import Label
#as soon as this reference to a kivy widget is enabled, multiple windows open up.
Label()