【问题标题】:How to interact with current running command cell in google colab?如何与 google colab 中当前正在运行的命令单元进行交互?
【发布时间】:2018-08-20 01:41:39
【问题描述】:

单元格如下所示

Cloning into 'XYZ'...
The authenticity of host 'github.com (192.**.###.113)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJIGOCWGl7E1spRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? 

如何给这个正在运行的命令单元格是或否?

【问题讨论】:

    标签: terminal jupyter-notebook google-colaboratory


    【解决方案1】:

    一旦进程运行,就没有简单的方法与进程进行交互;两种选择:

    1. yes 从shell 传递给程序,例如echo 'yes' | git ... 或只是y | git ...(如果y 用作响应)。
    2. 如果可能,请通过https 路径而不是git 路径进行克隆。

    【讨论】:

      【解决方案2】:

      与命令一起传递“-y”或“--yes”有效。

      例如:

      !pip 卸载 lightgbm --yes

      【讨论】:

      • 这不适用于所有 CLI,git clone 不接受 --yes
      猜你喜欢
      • 2021-05-29
      • 2021-12-19
      • 1970-01-01
      • 1970-01-01
      • 2021-05-05
      • 2020-03-03
      • 2014-02-13
      • 1970-01-01
      • 2015-02-12
      相关资源
      最近更新 更多