【发布时间】:2019-05-09 07:50:57
【问题描述】:
我有这样的功能-
def f(arg)
print(arg)
尝试像这样使用 Python Fire 传递参数 -
f hello there
输出 -
hello
【问题讨论】:
标签: python command-line command-line-interface command-line-arguments python-fire
我有这样的功能-
def f(arg)
print(arg)
尝试像这样使用 Python Fire 传递参数 -
f hello there
输出 -
hello
【问题讨论】:
标签: python command-line command-line-interface command-line-arguments python-fire
将输入包含在转义引号中后它起作用了 -
f \"hello there\"
输出 -
hello there
【讨论】:
hello 作为第一个参数,there 作为第二个参数。用引号将它绑定在一起形成单个参数hello there
hello 和there 之间的空格。如果这产生了您声称的输出,那么您在原始问题中遗漏了一些上下文。