【问题标题】:If doing "math foo bar", how to get foo and bar inside Mathematica?如果做“math foo bar”,如何在 Mathematica 中获取 foo 和 bar?
【发布时间】:2011-11-01 05:33:13
【问题描述】:

如果我将 Mathematica 作为“math foo bar”运行,哪些变量会保存 foo 和 酒吧?我猜它是 $Something,但还没有找到。

谷歌搜索告诉我 Mathematica 接受命令行选项,例如 -pwpath, -pwfile,但我找不到正确的搜索短语 命令行参数(不是选项)。

【问题讨论】:

  • 如果您可以访问文档,搜索“命令行”将返回$CommandLine 作为第一个命中...

标签: wolfram-mathematica


【解决方案1】:

$CommandLine 变量保存命令行参数。

$ math foo bar
In[1]:= $CommandLine
Out[1]= {math, foo, bar}

【讨论】:

    猜你喜欢
    • 2019-10-07
    • 1970-01-01
    • 2022-11-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-23
    • 2012-01-25
    相关资源
    最近更新 更多