switch from default env to virtualenv and back in script

fara user at compgroups.net/
Mon Jan 24 02:18:08 EST 2011


Hi,
My default environment uses Python2.6 but I have a also virtualenv with Python2.7 with different packages. Is it possible to write a script where some parts are executed in the default Python2.6 environment and some others in the Python2.7 virtualenv. Something like this:

##### Start of pseudoscript
import (Python2.6) packages
execute code in Python2.6
switch to Python2.7 virtualenv
import (Python2.7) packages
execute code in the Python2.7 virtualenv and store information for later use
switch back to default Python2.6
import (Python2.6) packages
execute Python2.6 functions
##### End of pseudoscript

Thanks
Fara





More information about the Python-list mailing list