![](/img/trans.png)
[英]How to change the name of dictionary in the file when using klepto.archives.file_archive?
[英]How to set a table name using klepto sqltable_archive in Python 3?
使用:
klepto.archives.sqltable_archive('sqlite:///foo.db', cached=False)
成功创建默认表名memo
的数据库
但是,当 table 也包括在内时:
klepto.archives.sqltable_archive('sqlite:///foo.db', table='bar', cached=False)
出现以下错误:
line 159, in __new__
archive = _sqltable_archive(db, table, **kwds)
TypeError: __init__() got multiple values for argument 'table'
指向klepto.archives
中的第 159行
任何帮助深表感谢!
我是klepto
的作者。 抱歉,那里的文档不清楚。 如果您查看上面的行(即第 158 行) ,您会看到表名是使用关键字name
... 设置的,然后将其拆分为db
名称和table
名。 我想当table
作为关键字参数给出时,我可能会抛出一个更好的错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.