I'm trying to write an image with
self.wfile.write(bytes(img.read()))
and it's working fine when I have self.send_header('Content-type','image/png')
but I need 'Content-type','text/html'
for other things that I do.
I tried
self.wfile.write(bytes("<img alt='Embedded Image' src='data:image/png;base64," + img.read() + "/>", "utf8"))
and I'm getting
TypeError: Can't convert 'bytes' object to str implicitly