Can't send multiple commands to EV3 using Python
Works for me if you set buffering to 0 and get rid of the newlines.

import time

# command to start motor on port A at speed 20
start_motor = '\x0C\x00\x00\x00\x80\x00\x00\xA4\x00\x01\x14\xA6\x00\x01'

# command to stop motor on port A
stop_motor = '\x09\x00\x01\x00\x80\x00\x00\xA3\x00\x01\x00'

# send commands to EV3 via bluetooth
with open('/dev/tty.EV3-SerialPort', 'w', 0) as bt:
    bt.write(start_motor)
    time.sleep(5)
    bt.write(stop_motor)