【问题标题】:Execute python script while open terminal打开终端时执行python脚本
【发布时间】:2015-07-04 15:41:46
【问题描述】:

我想要这个:在我打开终端时执行 python 脚本(我正在使用iTermfish-shell)。

【问题讨论】:

    标签: python shell python-2.7 terminal fish


    【解决方案1】:

    fish-shell 对我来说是新的,所以我阅读了文档 - 我非常推荐。查找标题“Initialisation Files”:http://fishshell.com/docs/current/index.html#initialization

    所以看起来你从~/.config/fish/config.fish调用你的python脚本

    所以我在我的 Macbook 上安装了 fish,我必须创建 config.fish 文件。我刚刚放置的:

    ~/gash.py
    

    在我的主目录中执行 python 程序gash.py。当然是#!行必须是正确的,我必须有执行权限(像往常一样)。我进入了fish shell,它执行了程序。

    谢谢,fish-shell 看起来很有趣。我喜欢stackoverflow。

    【讨论】:

      猜你喜欢
      • 2017-07-09
      • 2020-05-14
      • 2022-12-11
      • 2014-05-27
      • 2017-10-09
      • 1970-01-01
      • 2020-07-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多