communication between 2 programs in python

心已入冬 提交于 2019-12-04 22:48:59

问题


I have 2 programs that are both in python, one is 3rd Party and already been made. I want to run one in the foreground and one in the background. I want to set up a communication between the 2 programs, so I can tell the one in the foreground to do something, and it then tell the other program to do something. Such as on the foreground program I press a button, which then tell the other program to do something. What is the best way to do bout this?

I know I have asked a question about this before, but I feel that people might have found that too specific, so I have written a more simplified question.


回答1:


From my experience, rpyc is by far the simplest, most elegant, and most flexible way to go about it. http://rpyc.readthedocs.org/en/latest/




回答2:


You can use Manager from multiprocessing module.



来源:https://stackoverflow.com/questions/15206580/communication-between-2-programs-in-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!