Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/343.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 隐写术错误--';十六进制';不是文本编码;使用codecs.encode()处理任意编解码器_Python_Steganography - Fatal编程技术网

Python 隐写术错误--';十六进制';不是文本编码;使用codecs.encode()处理任意编解码器

Python 隐写术错误--';十六进制';不是文本编码;使用codecs.encode()处理任意编解码器,python,steganography,Python,Steganography,我对隐写术一无所知。尝试执行测试时,我遇到以下错误: 'hex' is not a text encoding; use codecs.encode() to handle arbitrary codecs 我读过关于binascii的文章,但是我怎样才能让它起作用呢 我的代码是: from __future__ import absolute_import, unicode_literals from steganography.steganography import Steganogr

我对隐写术一无所知。尝试执行测试时,我遇到以下错误:

 'hex' is not a text encoding; use codecs.encode() to handle arbitrary codecs
我读过关于binascii的文章,但是我怎样才能让它起作用呢

我的代码是:

from __future__ import absolute_import, unicode_literals
from steganography.steganography import Steganography

path = "/Users/cohen/Desktop/Screenshot_030.png"
output_path = "/Users/cohen/Desktop/output_steganography.png"

text = "/Users/cohen/Desktop/test.txt"

Steganography.encode(path, output_path, text) #---here is the line with error

谢谢大家!

事实上,我也刚刚检查过。该项目与Python 3不兼容

你可以在GitHub上找到很多很好的简单隐写模块,特别是如果你想测试LSB(最低有效位)技术的话。例如,此版本与Python 3兼容:

您可以要求项目维护人员更新代码以使用Python 3,或者仅使用Python 2。该项目目前与Python 3不兼容。谢谢!我教过他们的代码有点可疑。