how to read and write data with pyserial at same time

How can i make pyserial read and write at same time or at same program? Right now i only know how to either write or to read but not both simultaneiously. So how can i do it? I tried this simple code:

int incomingByte = 0;

void setup() {

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

}

void loop() {

incomingByte = Serial.read(); // read the incoming byte:

Serial.print(" I received:");

Serial.println(incomingByte);

}

and python program is:

import serial
ser = serial.Serial('/dev/ttyACM0',9600)
ser.write("333")
ser.close()
ser.open()
data = ser.readline()
print data
ser.close()

(deleted)

Have a look at this Python - Arduino demo

...R