Pyexcel,如何将字典保存到xls或csv文件?

问题描述 投票:1回答:1

我在使用pyexcel模块保存字典时遇到麻烦。

我用pip3 install pyexcel安装了pyxecel模块

所以我有一本字典,我正在这样做:

import pyexcel as pe
myDict = {...}
pe.save_as(dict = myDict, dest_file_name = "dest_file.xls")

在我的终端中,当我编译代码时,它打印出myDict,但是在我得到这个之后:]

Otherwise unrecognized parameters were given.

terminal output

我正在寻找解决方案,它可能与此有关:https://pyexcel-io.readthedocs.io/en/latest/pyinstaller.html但是我不明白如何在我的代码或终端中使用--hiden-import?当我在代码中使用此代码时,出现语法错误。

有人可以帮我吗?预先谢谢你。

我在使用pyexcel模块保存字典时遇到麻烦。我使用pip3 install pyexcel安装了pyxecel模块,所以我有一个字典,我正在这样做:将peexcel导入为pe myDict = {.....

python dictionary save xls pyexcel
1个回答
0
投票

之所以失败,是因为方法调用save_as()不接受名为dict的参数。根据文档,提供dict应该通过adictwith_keys参数来完成:

© www.soinside.com 2019 - 2024. All rights reserved.