2

你好世界!

我有一个泡菜文件(包含字节形式的图像)要打开,但是当我用泡菜打开它时,我得到了这个错误:

Traceback (most recent call last):
  File "test.py", line 20, in <module>
    if __name__ == "__main__": main()
  File "test.py", line 10, in main
    dump = pickle.load(file)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 0: ordinal not in range(128)

有人告诉我改用 klepto。这是我的尝试,但是当我加载并尝试打印数据时,它会打印“无”

localdb = dir_archive('E:\localdb', {}, serialized=True, cached=True)
print(localdb)
d = localdb.load('K_Select all images with a construction vehicle\output.pkl')
print(d)

这是输出:

dir_archive('localdb', {}, cached=True)
None

任何建议将不胜感激

4

0 回答 0