Issue
Dear pyqtgraph masters,
I want to execute pyqtgraph in a newly created process.
In my project there is a python module : trading.py. This module makes a new process using this code
p = Process(target = realDataProcess.realDataProcessStart, args=(self.TopStockList, self.requestCodeList, self.account))
And you know, To maintain pyqtgraph displaying the computer moniter, we have to use pyqt loop like below.
QApplication.instance().exec_()
But in new process, It seems that Above code doesn't work. My graph pops up and suddenly disappear.....
Is there any solution about this? please help me out.
Solution
My experience with multiprocess and pyqtgraph is, that you can't create a new pyqtgraph window on new processes. Therefore, you can only use pyqtgrahp on your main process. I think there was the explanation somewhere on the net.
If you want to create additional processes to do something, besides pyqtgraph, put your pyqtgraph code below if name == 'main': Otherwise, you will have as many windows as you have processes.
Answered By - PyQtGraph User
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.