Is there any way I can activate my virtual environment and run some process using that environment with a single call to subprocess.Popen
with shell=False
?
For example I need to run the following command via subprocess
. myvenv/bin/activate && robot myrobotscript.robot,
because I want to use the Robot Framework package from my virtual environment. I don't need a secure implementation so setting shell=True
wasn't a problem for me until I wanted to set a timeout for my process. Calling subprocess.kill()
, however, doesn't kill the child process and so the timeout is literally useless. That is, because when calling process.communicate()
with no timeout afterwars the behavior is the same as if I never passed a timeout to the method at all.