V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  wlxz  ›  全部回复第 1 页 / 共 1 页
回复总数  2
2017-12-06 12:53:13 +08:00
回复了 wlxz 创建的主题 Python 怎么将 tuple 作为 torndb 查询的 params 传进去?
原题答案如下:
def bar(*args):
print(type(args))
print(args)

t = ('1','2','3')
bar(*t)
参考:
https://stackoverflow.com/questions/5710391/converting-python-dict-to-kwargs
2017-12-03 08:17:57 +08:00
回复了 wlxz 创建的主题 Python 怎么将 tuple 作为 torndb 查询的 params 传进去?
出发点为: 在不可知数 多查询条件下,怎么用 torndo 进行查询
自己研究了一下,用**kwargs 方式解决了,
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1074 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 11ms · UTC 19:20 · PVG 03:20 · LAX 12:20 · JFK 15:20
Developed with CodeLauncher
♥ Do have faith in what you're doing.