Send bash environment variable back to python fabric

bash, fabric, python

Solution

Do it like this:

import os
os.getenv("PATH")

Problem

I am attempting to pass a bash environment variable back into my fabric function like this:- ``` from fabric.api import env def env_localhost(): "All the environment variables relating to your localhost" project_home = local('echo $PROJECT_HOME') print 111, project_home ``` But it doesn't seem to be able to retrieve the stdout results and assign it to my python `project_home` variable. What's the correct way to do this right?

Original source