Problems using "Process" while communicating with Python script

I am using a Python script on the Linino to read an image using PIL and just dumping the values to the 32u4.

The PIL function makes the entire image into a one-dimensional list, which I then print (to be returned to me in the 32u4) using a for loop. However I can't seem to be able to do that, and I believe it is because either the buffer is getting full and is unable to handle the rate at which the Linino end is pumping out data.

How best can I fix this ?

Sounds identical to the problem I had: FileIO in binary mode and Process oddities - Arduino Yún - Arduino Forum

It does indeed appear to be a buffering bug in Process.

Hmm, maybe. I am sending 16x8x3 (384) bytes though, so I am not even reaching the 65k byte limit. I think it might be because the Atheros processor is sending data much much faster than the 32u4 is receiving..

How are you reading the print out from your python script on the 32u4?

Process readvalues;
readvalues.runCommand("python script.py");
while (readvalues.available())>0)
{
char c = readvalues.read();
Serial.println(c);
}
delay(5000);

ankitdaf:
Process readvalues;
readvalues.runCommand("python script.py");
while (readvalues.available())>0)
{
char c = readvalues.read();
Serial.println(c);
}
delay(5000);

you have syntax error there, should be:

while (readvalues.available() > 0)