Python writes string to memory, reads memory with another Python program

I am getting with my Python program a string with 12 comma separated values ​​over Ethernet.

Now I want to provide values ​​for other programs, but I don't want to write the values ​​in a file. Writing to the file will happen very often and thus strain my RaspberryPi's SD card.

Other programs must read and not write values.

Can someone tell me if it is possible to write a complete string or split values ​​to a specific memory space by reading that space with other Python programs?

I am using python at version 2.7.

Hope my english is good enough to explain the problem. Thank you for your help.

+3


source to share


2 answers


You are looking for information about shared memory. I haven't used it personally, but here are some resources I found:



+3


source


@dsh has already provided some information about shared memory, another (slightly higher level) idea I could recommend is to use python sockets .



They have great practice in socket injection and I recommend that you check the non-blocking STREAM socket for communication between your programs.

+2


source







All Articles