# Hook Scripts

virtualenvwrapper adds several hook points you can use to change your settings, shell environment, or other configuration values when creating, deleting, or moving between environments. They are either sourced (allowing them to modify your shell environment) or run as an external program at the appropriate trigger time.

## Environment Hooks

### postactivate

The $VIRTUAL_ENV/bin/postactivate script is sourced after the new environment is enabled.$VIRTUAL_ENV refers to the new environment at the time the script runs.

This example script for the PyMOTW environment changes the current working directory and the PATH variable to refer to the source tree containing the PyMOTW source.

pymotw_root=/Users/dhellmann/Documents/PyMOTW