【问题标题】:Running external commands in IPython在 IPython 中运行外部命令
【发布时间】:2010-08-04 19:25:02
【问题描述】:

我想从 IPython 配置中运行一个新命令并捕获它的输出。基本上,我想通过普通函数访问 !command 的等价物。我知道我可以只使用subprocess,但是由于 IPython 已经提供了这个功能,我猜想 API 中一定有一个正确制作的包装器。

【问题讨论】:

    标签: subprocess ipython execution


    【解决方案1】:

    显然,这样的包装器可以通过ip.IP.getoutput("command")调用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-10-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多