-2

I m using Windows 7, I wanted a way where I could run my python file and it would execute my virtual environment. I have read the following commands

activate_this_file = "/path/to/virtualenv/bin/activate_this.py"
execfile(activate_this_file, dict(__file__=activate_this_file))

I need to know what is /path/to/virtualenv/bin/ and what is activate_this.py? Anyone know better solution for this?

mshsayem
  • 17,557
  • 11
  • 61
  • 69
Dheeraj
  • 59
  • 1
  • 10

1 Answers1

1

/path/to/virtualenv/bin/ is the path to the virtualenv you want to activate. For example, if you have run virtualenv xyzzy in directory /home/dheeraj/venv the path is /home/dheeraj/venv/xyzzy/bin/.

activate_this.py is an activation script created by virtualenv.

phd
  • 82,685
  • 13
  • 120
  • 165