python check virtual environment code example
Example 1: virtualenv python2
virtualenv --python=/usr/bin/python2.6 <path/to/new/virtualenv/>
Example 2: how virtual environment in python works
>>> import sys
>>> sys.prefix
'/System/Library/Frameworks/Python.framework/Versions/3.5'