You can convert a string into an array of integers 0 <= N <= 256 by either:
map(ord,command+'\n')
or
bytearray(command+'\n',"UTF-8")
If you had to write each byte one by one to the port:
>>> for b in bytearray("message\n","UTF-8"):
... port.write(b)
Should do the trick.