title: How to send ascii characters through serial in python?
body: <p>I want to send 3 numbers (integers) through serial port in ascii format. I use putty terminal to see the receiving data on the other end. The problem is that putty doesn't shows anything except strings. I tried to use the ord() function to get the ascii format but I cannot see anything on putty. Is it just a putty problem with ascii format, or I don't send data at all? How can I be sure that I send the data in the correct format (ascii)? 
  I am new to python, so sorry if this sounds trivial.
  I use Ubuntu 16.04 LTS and Python 2.7.12.
  Thank you in advance! </p>
  
  <pre><code>#!/opt/bin/python
  import serial
  import time
  
  camera = [0, 0, 0]
  
  ser = serial.Serial('/dev/ttyUSB0', 9600)
  print (ser.name)
  print ("Port Open")
  time.sleep(2)
  while ser.isOpen():
      for i in range(1):
          #ser.write(b'5')
          #ser.write(chr(5)) 
          #ser.write(5)
          ser.write(ord(str(camera[0])))
          #ser.write(bytes(camera))
          print(camera)
          time.sleep(1)
          camera[1] = camera[1] + 1
  
  ser.close()
  </code></pre>