Little problem with multiprocessing used inside Python3 application.
I want to create an application for RPI4, that has GPIO management and cooperate's with written in PyQT5 GUI.
To simplify my problem. Problem is that input() statement in Python make child process with GUI to stop.
This is what's works (code inside main file):
import multiprocessing
from PyQt5 import QtWidgets
def processGUI():
app = QtWidgets.QApplication(sys.argv)
mwc = MainWindowController()
mwc.show()
app.exec_()
if __name__ == '__main__':
process1 = multiprocessing.Process(target=processGUI)
process1.start()
while True:
pass
process1.join()
GUI show's up despite main process going into infinite loop.
Now, if I change that loop into something like that:
import multiprocessing
from PyQt5 import QtWidgets
def processGUI():
app = QtWidgets.QApplication(sys.argv)
mwc = MainWindowController()
mwc.show()
app.exec_()
if __name__ == '__main__':
process1 = multiprocessing.Process(target=processGUI)
process1.start()
while True:
strInput = input()
if strInput == "END":
break
process1.join()
GUI don't shows up. Or it show up after I type "END" in standard input.
My question is? Why function input() stop's other process from work?