Quickly activate a virtualenv
It really is a pain to type source env/bin/activate
every single time to activate a python virtualenv so i just cooked up a simple function that i add to my shell that does it for me
Note: I always create my virtualenv in a folder called env
so that is hardcoded in there. It has to be changed as required
function a()
{
if [ -d "env" ]
then
source env/bin/activate
else
echo "Directory doesn't contain a virtualenv"
fi
}
Written by Shrayas Rajagopal
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Python
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#