Issues Reading from Raspberry Pi Serial Port with Python

Hi, I am working on a project that uses a Raspberry Pi in conjunction with an Arduino which reads analog values from a potentiometer and sends them to the serial port, which are then read by the Pi. I wrote a simple program to test this out, which reads incoming data from the Pi, converts it to an integer value and prints it, which works great on my Mac, but does not work on my Pi. I get the following error:

value = ord(serial.read())
TypeError: ord(): expected a character, but a string of length 0 found

I have tried different values for timeout, with timeout = none the program just waits forever.
Here is my Python and Arduino Code, please let me know if you see anything wrong or have an suggestions. Thanks!

Python:

import serial
from time import sleep

ser = serial.Serial(
    port='/dev/ttyUSB0',\
    baudrate=9600,\
    parity=serial.PARITY_NONE,\
    stopbits=serial.STOPBITS_ONE,\
    bytesize=serial.EIGHTBITS,\
        timeout=1)

#/dev/tty.usbserial-AH02OC4V for mac, command line to find port: ls /dev/tty.*
#/dev/ttyUSB0 for Pi/Linux, command line to find port: ls /dev/tty*

value = 0
while True:
	ser.write("a")
	value = ord(ser.read())
	print "value: " 
	print value
	sleep(.5)

Arduino:

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  if (Serial.available() > 0)
  {
    int pyVal = Serial.read();
    int potVal = analogRead(0)/4;
    Serial.write(potVal);
  }
}

I have no idea what differences there may be between Python on a Mac and on an RPi (somewhat outside the scope of the Arduino Forum). Are they both using the same Python version - there can be problems with 3 vs 2.7

You may wish to try this Python - Arduino demo which works with Python 2.7 and has not been tested with Python 3.

...R

Put a sleep between the python write and read.