python autoenv的使用方法

https://gist.github.com/appleshan/70cc730d7fefa348dd844f9e59cbec2e

 

发现链接打不开,直接就粘过来了。侵删

#+TITLE: python 的 autoenv 使用简明手册
  • kennethreitz/autoenv
    只需了解:
  • 当进入目录,载入: .env
  • 当离开目录,载入: .env.leave

** 安装
当只使用 kennethreitz/autoenv,
先使用 git 方式安装了 autoenv 。

** 配置

  • .zshrc

+BEGIN_SRC sh

source ~/.autoenv/activate.sh
export AUTOENV_ENABLE_LEAVE=true

+END_SRC

  • .env

+BEGIN_EXAMPLE

. /home/appleshan/.local/share/virtualenvs/test_pipenv-iVWx5v4Q/bin/activate

+END_EXAMPLE

  • .env.leave

+BEGIN_EXAMPLE

deactivate

+END_EXAMPLE

  • Tarrasch/zsh-autoenv
    只需了解:
  • 当进入目录,载入: .autoenv.zsh
  • 当离开目录,载入: .autoenv_leave.zsh

** 安装
当只使用 Tarrasch/zsh-autoenv,
使用 git 方式安装了 zsh-autoenv 。

** 配置

  • .zshrc

+BEGIN_SRC sh

source ~/.oh-my-zsh/custom/plugins/zsh-autoenv/autoenv.zsh

+END_SRC

  • .autoenv.zsh

+BEGIN_SRC sh

echo "进入 pipenv.";
. /home/appleshan/.local/share/virtualenvs/test_pipenv-iVWx5v4Q/bin/activate

+END_SRC

或者

+BEGIN_SRC sh

echo "进入 pipenv.";
. ./.venv/bin/activate

+END_SRC

  • .autoenv_leave.zsh

+BEGIN_SRC sh

deactivate
echo "离开了 pipenv.";

+END_SRC

  • 参考资料
posted @ 2019-02-20 16:51  琵琶真的行  阅读(587)  评论(0编辑  收藏  举报