Use the handset and enter
The easiest way to handle this is to simply use popen(3) . The popen function is available in both Python and C and will connect a program of any language to another using a channel.
>>> import subprocess >>> print args ['/bin/vikings', '-input', 'eggs.txt', '-output', 'spam spam.txt', '-cmd', "echo '$MONEY'"] >>> p = subprocess.Popen(args)
Once you have the pipe, you should probably send yaml or json through it, although I never tried to read in C. If this is a really simple stream, just analyze it yourself. If you like XML, I suggest that this is also available.
Digitaloss
source share