Skip to content

Instantly share code, notes, and snippets.

@mike1e mike1e/venv_folder
Last active Dec 29, 2015

Embed
What would you like to do?
switch folders with virtualenv
# In the postmkvirtualenv script I have the following to create a directory based on the project name,
# add that directory to the python path and then cd into it:
proj_name=$(echo $VIRTUAL_ENV|awk -F'/' '{print $NF}')
mkdir $HOME/projects/$proj_name
add2virtualenv $HOME/projects/$proj_name
cd $HOME/projects/$proj_name
# In the postactivate script I have it set to automatically change to the project
# directory when I use the workon command:
proj_name=$(echo $VIRTUAL_ENV|awk -F'/' '{print $NF}')
cd ~/projects/$proj_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.