from PIL import Image
import stepic
img = Image.open ('a.png')
img2 = stepic.encode(img, 'hello world')
img2.show()在这里,代码给出了以下错误:
TypeError:不支持的操作数类型(S)用于&:'str‘和'int’
使用Python 3.6。
发布于 2018-12-12 14:04:17
同样的问题..。我在Python3.6.6上进行了测试,只需将下面的行更改如下:
img2 = stepic.encode(img, 'hello world')至:
img2 = stepic.encode(img, b'hello world')您需要将数据/文本作为二进制传递。
https://stackoverflow.com/questions/49155658
复制相似问题