openlang

怎样输出到 Nim 的标准错误流?

我知道 echo 会输出到 stdout。能让 echo 改用 stderr 吗,还是说写入 stderr 需要别的方法?

从英语翻译查看原文

后续讨论 2

顺着彼此的依据读下去
  1. 固定链接

    也可以调用 writeLine( https://nim-lang.org/docs/io.html#writeLine%2CFile%2Cvarargs%5BTy%2C%5D )。它列在 system 的 Exports 中( https://nim-lang.org/docs/system.html#19 )。echo 的文档( https://nim-lang.org/docs/system.html#echo%2Cvarargs%5Btyped%2C%5D )还建议像下面这样调用 flushFile( https://nim-lang.org/docs/io.html#flushFile,File )。

    writeLine(stderr,
              "my failure")
    flushFile(stderr)

    我用 Nim 1.4.2 测试过。

    从英语翻译查看原文

同一个问题的其他角度

  1. 通过 Google Colab 使用 MATLAB

    能在 Google Colab (云端的 Jupyter) 中使用 MATLAB 命令吗? 例如,我想在 Google Colab 中调用 Risk Management Toolbox 的函数,比如 bin(vbt, Name, Value)、tb…

    回复 2最近活动 matlab
  2. gdb 能否按地址在汇编指令处设置断点?

    我的尝试如下。 不过,看起来并不存在这条命令。 gdb 能实现这样的功能吗?

    回复 2最近活动 assembly
  3. Playwright 断言能否允许两个文本值中的任意一个?

    我想验证文本中包含 one 或 two。 在 Playwright 中能这样实现吗? 同样的写法也能用在句子内部吗,比如下面这样

    回复 2最近活动 typescript