Search code examples
c#pythondata-sharingmultiple-languages

How to share data between programs that use different languages to run


I want to share data between programs that run locally which uses different languages, I don't know how to approach this.

For example, if I have a program that uses C# to run and another that uses python to run, and I want to share some strings between the two, how can I do it?

I thought about using sockets for this but I'm not sure that this is the right approach, I also thought about saving the data in a file, then reading the file from the other program, but, it might even be worse than using sockets.

Note that I need to share strings almost a thousand times between the programs


Solution

  • There are a lot of ways to do so, I would recommend you reading more about IPC (Inter Process Communication) - sockets, pipes, named pipes, shared memory and etc...

    Each method has it's own advantages, therefore, you need to think about what you're trying to achieve and choose the method that fits you the best.