我有一个接受n多个参数的函数(它是devinus/sh函数),您可以在其中执行命令行程序并获得结果:
例: Sh.file "-b", "--mime-type", path_to_file
但我希望在数组中包含参数,以便它们可以根据函数的调用方式而变化.
我想要的例子:
data = ["-b", "--mime-type", path_to_file]
# a way of going through the array and turning it into the parameters for the Sh function
Sh.file <loop array params here>
Run Code Online (Sandbox Code Playgroud)
Sh不为参数采用数组.
有任何想法吗?
| 归档时间: |
|
| 查看次数: |
451 次 |
| 最近记录: |