code: def write(self, file):
          
  
          w = Writer(**self.info)
          w.write(file, self.rows)
docs: Write the image to the open file object.
  
          See `.save()` if you have a filename.
  
          In general, you can only call this method once;
          after it has been called the first time the PNG image is written,
          the source data will have been streamed, and
          cannot be streamed again.