import base64 mycode = "print \'Hello World!\'" secret = base64.b64encode(mycode) print(secret)
This code doesn\'t work it says bytes-like