Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在项目中始终使用相同的选项卡时,如何简化bash的使用?_Python_Macos_Bash_Terminal - Fatal编程技术网

Python 在项目中始终使用相同的选项卡时,如何简化bash的使用?

Python 在项目中始终使用相同的选项卡时,如何简化bash的使用?,python,macos,bash,terminal,Python,Macos,Bash,Terminal,当使用iTerm2在MacOSX终端上开发网站时,我总是打开相同的bash选项卡 直到现在,当我开始编码时,我打开iTerm2并启动3个选项卡。然后,我将cd放入我的项目文件夹,使用“source-venv/bin/activate”激活虚拟环境,并执行下面描述的三个独立任务 我想精简一下 以下是我在iTerms选项卡中执行的任务: 为Django运行开发服务器,例如python3 manage runserver 运行测试时,通常只需两个命令python3 manage test和python

当使用iTerm2在MacOSX终端上开发网站时,我总是打开相同的bash选项卡

直到现在,当我开始编码时,我打开iTerm2并启动3个选项卡。然后,我将
cd
放入我的项目文件夹,使用“source-venv/bin/activate”激活虚拟环境,并执行下面描述的三个独立任务

我想精简一下

以下是我在iTerms选项卡中执行的任务:

  • 为Django运行开发服务器,例如python3 manage runserver
  • 运行测试时,通常只需两个命令
    python3 manage test
    python3 manage functional\u test
  • 使用
    less
    浏览项目文件夹,或使用
    touch
    subl
    创建新文件,或使用
    pip
    pip3
    安装缺少的软件包
  • 是否有类似于iTerm/bash的项目脚本这样的内容

    • 启动三个选项卡,全部位于项目文件夹中
    • 在所有这些应用程序中激活
      virtualenv
    我如何加快重复命令的速度,例如用于测试的命令?

    如果您愿意使用,您可以在创建会话之前激活virtualenv。除此之外,如果您可以从会话中分离出来而不是结束会话,那么,这甚至比编写脚本来启动会话要好

    当然,这也是可能的:

    #/垃圾箱/垃圾箱
    tmux新窗口python3管理runserver
    #或
    tmux新窗口“python3管理runserver”;zsh-i
    
    您可以将所有任务绑定到tmux中的键。

    此处: