title: ord() function in Python 3.6
body: <p>Trying to open a project from Python 2.7 on Python 3.6. I run into a problem with <code>ord()</code> function there. </p>
  
  <p>Working with Python 2.7 is fine with <code>ord()</code> and I'm getting my outputting image file with the same picture. I mean, I can write bytes of infromation in the picture , I'm giving. </p>
  
  <p>But as for Python 3.6 I tried not to call <code>ord()</code> and I'm getting a line with recording information instead of my real picture with the infromation, like it was with python 2.7. </p>
  
  <pre><code>from PIL import Image
  import sys
  textfile = open(sys.argv[1],'rb')
  textstring = textfile.read()
  textfile.close()
  xval = 500
  yval = int(len(textstring)/(xval*4) + 1)
  im = Image.new('RGBA', (xval,yval), (0,0,0,0))
  width = xval
  height = yval
  count = 0
  for y in range (0,height):
      for x in range (0,width):
          if count == len(textstring) - 4:
              im.putpixel((x,y),(ord(textstring[count]),ord(textstring[count + 1]),ord(textstring[count + 2]),ord(textstring[count + 3])))
              break
          if count == len(textstring) - 3:
              im.putpixel((x,y),(ord(textstring[count]),ord(textstring[count + 1]),ord(textstring[count + 2]),0))
              break
          if count == len(textstring) - 2:
              im.putpixel((x,y),(ord(textstring[count]),ord(textstring[count + 1]),0,0))
              break
          if count == len(textstring) - 1:
              im.putpixel((x,y),(ord(textstring[count]),0,0,0))
              break
          im.putpixel((x,y),(ord(textstring[count]),ord(textstring[count + 1]),ord(textstring[count + 2]),ord(textstring[count + 3])))
          count += 4
  im.save(sys.argv[2])
  </code></pre>
  
  <p>In python 3, I get an error ,using <code>ord()</code>:</p>
  
  <blockquote>
    <p>TypeError: ord() expected string of length 1, but int found
    im.putpixel((x,y),(ord(textstring[count]),ord(textstring[count + 1]),ord(textstring[count + 2]),ord(textstring[count + 3])))</p>
  </blockquote>
  
  <p>I was trying to add <code>b</code> instead of <code>ord()</code> but it wasn't succesful.</p>
  
  <p>For running a program need to add args: <code>python encryption.py inputfile image.png</code>
  Can you give some advice ,how I should fix it? Thanks.</p>