On 09Jul2014 11:42, Steven D'Aprano <st...@pearwood.info> wrote:
On Tue, Jul 08, 2014 at 03:45:42PM -0500, Jim Byrnes wrote:
I would like to automate running virtualenv with a python script by:

opening gnome-terminal
cd to proper directory
run source /bin/activate

Why not just run /bin/activate directly from Python?

os.chdir("the/proper/directory")
os.system("/bin/activate")

Because "activate" needs to be sourced by the shell. It hacks the environment.

Cheers,
Cameron Simpson <c...@zip.com.au>

If at first you don't succeed, your sky-diving days are over.
        - Paul Blumstein, pa...@harley.tti.com, DoD #36
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to