title: Python 2.7 read exported variables from bash
body: <p>I have a python2.7 script which is calling a bash script, inside the bash script i'm exporting 2 variable i've tried with <code>declare -x</code> and with <code>export</code>, then i'm trying to read this variables in the python script using <code>os.getenv</code> and i also tried using <code>os.environ</code> but i'm getting  a <code>None</code>type each time.
  Here is a snippet from my scripts:</p>
  
  <p>Python:</p>
  
  <pre><code>def set_perforce_workspace():
          global workspace_path
          global workspace_root_path
          script_path = "somePath"
          depot_name = "TestingTools"
          dir_to_download = "vtf"
          bash_command = "./createWorkspace.sh " + "-d " + depot_name + " -w " \
                         + PerforceUtils.WORKSPACE_NAME + " -a " + dir_to_download
          print bash_command
          print os.getcwd()
          try:
              os.chdir(script_path)
          except OSError as e:
              print "Error: {0}".format(e)
          print os.getcwd()
          return_code = call([bash_command], shell=True)
          test = os.getenv("workspace_path")
          print "this is test {0}".format(test)
          workspace_path = os.getenv("workspace_path")
          workspace_root_path = os.getenv("workspace_root_path")
          print "This is the return code {0}".format(return_code)
          print "this is the workspace path: {0}".format(workspace_path)
          print "this is the workspace root path: {0}".format(workspace_root_path)
          return return_code
  </code></pre>
  
  <p>Bash:</p>
  
  <pre><code>declare -x workspace_root_path="$workspaceProjPath"
  export workspace_path="$workspaceProjPathLocal"
  </code></pre>