Guest User

Untitled

a guest
Oct 11th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. sample.py contains following
  2. def run_cmd(self, cmd):
  3. self.logger.debug("Running command : %s" % cmd)
  4. process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
  5. stderr=subprocess.PIPE)
  6.  
  7. cmd = "source .x-venv/bin/activate; "
  8. run_cmd(cmd)
  9. call_do_something()
  10.  
  11. And sample.py is invoked as
  12. # source .y-venv/bin/activate
  13. will the call_do_something be executed in x-venv or y-venv.
  14. Just to make things more complicated lets say y-venv is a python2 venv and x-venv is a python3 venv
Add Comment
Please, Sign In to add comment