integer exchange: python <-> arduino

Ok, Im the noo noob on the block, so apologies if this question was already addressed in the past.

I am using Python's "serial" module to send data to the Freeduino. I am trying to send integers [0 to 1023] to the Freeduino, but I do not see the intended integers on the Serial monitor.

Python program:

import serial

ser = serial.Serial('/dev/ttyUSB0', 9600)

for i in range(1024):
ser.write(str(i))

Arduino program:

int incomingByte = 0; // for incoming serial data

void setup() {
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
}

void loop() {

// send data only when you receive data:
if (Serial.available() > 0) {
// read the incoming byte:
incomingByte = int(Serial.read());

// say what you got:
Serial.print("I received: ");
Serial.println(incomingByte, DEC);
}
}

On the serial monitor, I see the following:
....
received: 54
I received: 49
I received: 57
I received: 56
I received: 55
I received: 57
I received: 57
I received: 50
I received: 54
I received: 48
I received: 52
I received: 56
I received: 50

How do I get the actual values on the Freeduino?

Thanks in advance,
A

For integer, what kind of encodings do you want to use from your host (pyserial) to Arduino?

ser.write(str(i)) writes a string of integer i in decimal human readable representation. (e.g. i = 100, str(i) => '100')

In Arduino, you need to find a way to distinguish a series of input. For example, if your host loops i from 0 to 5, the Arduino board will see a string stream: '12345'. You shall add a delimiter to help Arduino tell apart the integer string:
ser.write(str(i) + '.')

On Arduino side, you can compose the integer stream by your own, or you can consider using Serial.parseInt(), which looks ahead of integer stream until a non-integer character is occurred or a timeout reached.

if (Serial.available() > 0) {
int cmd = Serial.parseInt();
Serial.read(); // consume delimiter
Serial.print("received:");
Serial.println(cmd, DEC);
}

By the way, how do you set up a console monitor when you use the USB for Pyserial to send integers?