title: How to replace environment variable value in yaml file to be parsed using python script
body: <p>I need to use environment variable "PATH" in yaml file which needs to be parsed with a script.  </p>
  
  <p>This is the environment variable I have set on my terminal:</p>
  
  <pre><code>$ echo $PATH
  /Users/abc/Downloads/tbwork
  </code></pre>
  
  <p>This is my sample.yml:</p>
  
  <pre><code>---
  Top: ${PATH}/my.txt
  Vars:
  - a
  - b
  </code></pre>
  
  <p>When I parse this yaml file with my script, I don't see <code>PATH</code> variables actual value. </p>
  
  <p>This is my script:</p>
  
  <pre><code>import yaml
  import os
  import sys
  
  stream = open("sample.yml", "r")
  docs = yaml.load_all(stream)
  for doc in docs:
      for k,v in doc.items():
          print k, "-&gt;", v
      print "\n",
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Top -&gt; ${PATH}/my.txt
  Vars -&gt; ['a', 'b']
  </code></pre>
  
  <p>Expected output is:</p>
  
  <pre><code>Top -&gt; /Users/abc/Downloads/tbwork/my.txt
  Vars -&gt; ['a', 'b']
  </code></pre>
  
  <p>Can someone help me figuring out the correct way to do it if I am doing it wrong way?</p>