title: Writing exif data to the exif header using PyExifTool
body: <p>Looking over a post from 2015 <a href="https://stackoverflow.com/questions/27815719/editing-updating-the-data-of-photo-metadata-using-pyexiftool">link</a> on how to use PyExifTool to write to the Exif header. I gave it a try:</p>
  
  <pre><code>import exiftool
  fileno=r'DSC00001.JPG
  with exiftool.ExifTool() as et:
      et.execute("EXIF:GPSLongitude=100",fileno)
      et.execute("EXIF:GPSLatitude=100",fileno)
  </code></pre>
  
  <p>In response, I got the following error:</p>
  
  <pre><code>TypeError: sequence item 0: expected a bytes-like object, str found
  </code></pre>
  
  <p>Then as specified in the <a href="http://smarnach.github.io/pyexiftool/#" rel="nofollow noreferrer">documentation</a>, execute takes byte commands, so I bites, so I tried that too:</p>
  
  <pre><code>with exiftool.ExifTool() as et:
     et.execute(bytes("EXIF:GPSLongitude=100", 'utf-8'),fileno)
     et.execute(bytes("EXIF:GPSLatitude=50",'utf-8'),fileno)
  </code></pre>
  
  <p>But still got the same error :</p>
  
  <pre><code>TypeError: sequence item 1: expected a bytes-like object, str found
  </code></pre>
  
  <p>I am not sure what am I doing wrong, and if Exiftool can write to file.</p>