MarAja
MarAja

Reputation: 1597

Simple way to make python programs communicate

I have an RDB (let say an SQLite). I wrote a module that connects to the RDB and can aggregates some results (to get basic statistics about my data). Let's call this module "aggregator". Now I would like to write a local client that sends requests to my aggregator module to ask it some calculations (let's call this module client), wait for the answer and print it when it gets returned for example (or use it for anything else).

In my situation both of my modules (client and aggregator) are local (and I am working on a Linux).

I would like to find a simple way to make both system interact.

I have heard about "DBus" but I am wondering if it is suitable in my situation (and if it is not overkill).

Upvotes: 1

Views: 303

Answers (1)

kmaork
kmaork

Reputation: 6012

I would use sockets. Python makes it super easy to do: you have the standard socket library, with which you can pass pickle-dumped objects, dumped json or just strings between your programs.

Upvotes: 2

Related Questions