ipc

How to solve this simple one-way local machine messaging problem

How to solve this simple one-way local machine messaging problem Question: I have a first sender script in Python 3.10 which needs to send some data def post_updates(*args): sender.send_message("optional_key", args) Then a second receiver script in Python 3.7 which needs to receive this data while True: args = receiver.get_message("optional_key", blocking=True) print("args received:", args) Constraints: Each …

Total answers: 2

Best practice for communication between different modules in python

Best practice for communication between different modules in python Question: I revisited the development of an application in python I wrote 5 years ago (It was my first interesting project/application in python 2.7, and as I revisit it now I am struggling to make heads or tails). The application had the following units/modules: got data …

Total answers: 1

wait process until all subprocess finish?

wait process until all subprocess finish? Question: I have a main process which creates two or more sub processes, I want main process to wait until all sub processes finish their operations and exits? # main_script.py p1 = subprocess.Popen([‘python script1.py’]) p2 = subprocess.Popen([‘python script2.py’]) … #wait main process until both p1, p2 finish … Asked …

Total answers: 2

Can I raise a signal from python?

Can I raise a signal from python? Question: The topic basically tells what I want to to. I read the documentation, which tells me how to handle signals but not how I can do signalling by myself. Thanks! Asked By: Simbi || Source Answers: Use os.kill. For example, to send SIGUSR1 to your own process, …

Total answers: 4

Exception in Thread:must be a sequence, not instance

Exception in Thread:must be a sequence, not instance Question: Im working on python and im trying to execute a thread that takes 1 parameter “q”, but when im trying to execute it a strange exception occurs, here’s my code: class Workspace(QMainWindow, Ui_MainWindow): “”” This class is for managing the whole GUI `Workspace’. Currently a Workspace …

Total answers: 1

Combining node.js and Python

Combining node.js and Python Question: Node.js is a perfect match for our web project, but there are few computational tasks for which we would prefer Python. We also already have a Python code for them. We are highly concerned about speed, what is the most elegant way how to call a Python “worker” from node.js …

Total answers: 7

Interprocess communication in Python

Interprocess communication in Python Question: What is a good way to communicate between two separate Python runtimes? Thing’s I’ve tried: reading/writing on named pipes e.g. os.mkfifo (feels hacky) dbus services (worked on desktop, but too heavyweight for headless) sockets (seems too low-level; surely there’s a higher level module to use?) My basic requirement is to …

Total answers: 8

Simple IPC between C++ and Python (cross platform)

Simple IPC between C++ and Python (cross platform) Question: I have a C++ process running in the background that will be generating ‘events’ infrequently that a Python process running on the same box will need to pick up. The code on the C side needs to be as lightweight as possible. The Python side is …

Total answers: 7

blocks – send input to python subprocess pipeline

blocks – send input to python subprocess pipeline Question: I’m testing subprocesses pipelines with python. I’m aware that I can do what the programs below do in python directly, but that’s not the point. I just want to test the pipeline so I know how to use it. My system is Linux Ubuntu 9.04 with …

Total answers: 11