I am curious as to the best way to share data from a WPF program with a python script from within a loop where the values are continuously being updated. Here is a psuedo-codish example that expresses the kind of functionality I'm hoping for.
Wpf example:
while(true)
{
var x = arbitraryNumber0;
var y = arbitraryNumber1;
var z = arbitraryNumber2;
sendToPython(arbitraryNumber0, arbitraryNumber1, arbitraryNumber2);
arbitraryNumber0++;
arbitraryNumber1++;
arbitraryNumber2++;
}
Python script example:
#stream in x, y, z From WPF
product = arbNumFromWPF0 * arbNumFromWPF1 * arbNumFromWPF2
#do stuff with product
I have tried using c# process's but the problem was that it would need to start the python shell on every new iteration. Which would cause my system to crash. I have looked into ironpython, pipes, and sockets but can not find an example similar to what I'm trying to do, and am wondering what method I should use to achieve this functionality. Any help would be greatly appreciated.