如何打开微笑fi

2024-09-28 21:03:29 发布

您现在位置:Python中文网/ 问答频道 /正文

我想导出一些数据到安装在我手机上的应用程序。因此,我在应用程序中导出了一些虚拟数据,以便研究如何生成要导入的数据。在

第一步:它是一个gzip文件。没问题,这就是gunzip的目的。在

第二步:

$ file export
export: Smile binary data version 0: binary encoded, shared String values disabled, shared field names

我从来没有听说过一个smile文件(这对google来说很难看,因为表情符号),但是我找到了pySmile。问题:关于python,我甚至不是一个傻瓜。更具体地说:我对python一无所知。在

但我无论如何都试过了。在

^{pr2}$

这在我自己生成的smile文件中运行得很好,但是对于给定的导出smile文件,我得到了以下错误:

Traceback (most recent call last):
  File "dec.py", line 7, in <module>
    o=pysmile.decode(a)
  File "/usr/local/lib/python2.7/dist-packages/pysmile/decode.py", line 224, in decode
    state.copy_shared_value_string()
  File "/usr/local/lib/python2.7/dist-packages/pysmile/decode.py", line 151, in copy_shared_value_string
    raise SMILEDecodeError('Cannot lookup shared value, sharing disabled!')
pysmile.decode.SMILEDecodeError: Cannot lookup shared value, sharing disabled!

之后,我试图调查这两个文件之间的区别是:

export: Smile binary data version 0: binary encoded, shared String values disabled, shared field names enabled
dummyf: Smile binary data version 0: binary encoded, shared String values enabled, shared field names enabled

除了错误跟踪之外,这还引出了我的问题:如何在pysmile中启用共享(解码和编码),还有没有另一种不依赖python的方法将smile文件转换为文本文件(这一点更重要)呢?在


Tags: 文件数据datastringvalueversionexportshared