With bash, you can create a generic virtual env wrapper that you can use to invoke any command, much like how time
can wrapper any command.
virt_env_wrapper.bash
:
#!/bin/bash source path/to/virtual/env/bin/activate"$@"
Bash's magical incantation "$@"
re-escapes all tokens on the original command line so that if you were to invoke:
virt_env_wrapper.bash python foo.py bar 'baz blap'
foo.py
would see a sys.argv
of ['bar', 'baz blap']