2
from PIL import Image
import stepic
img = Image.open ('a.png')
img2 = stepic.encode(img, 'hello world')
img2.show()

Here the code is giving the following error:

TypeError: unsupported operand type(s) for &: 'str' and 'int'

Python 3.6 is used.

Barbaros Özhan
  • 59,113
  • 10
  • 31
  • 55
shubhamr238
  • 1,226
  • 14
  • 22

1 Answers1

1

had the same problem.. I tested on Python 3.6.6 simply change the line below FROM:

img2 = stepic.encode(img, 'hello world')

TO:

img2 = stepic.encode(img, b'hello world')

you need to pass your data/text as binary

Paddy Popeye
  • 1,634
  • 1
  • 16
  • 29