sys.stdout.buffer (instead of sys.stdin and sys.stdout) to use the bytes API
Attach a file by drag & drop or click to upload