title: Parsing yaml file and getting a dictionary
body: <p>I'd like to be able to take the YAML defined below and turn it into a dictionary.</p>
  
  <pre><code>development:
      user:dev_uid
      pass:dev_pwd
      host:127.0.0.1
      database:dev_db
  
  production:
      user:uid
      pass:pwd
      host:127.0.0.2
      database:db
  </code></pre>
  
  <p>I have been able to use the YAML library to load the data in. However, my dictionary appears to contain the environmental items as a long string.</p>
  
  <p>This code:</p>
  
  <pre><code>#!/usr/bin/python3
  
  import yaml
  
  config  = yaml.load(open('database.conf', 'r'))
  
  print(config['development'])
  </code></pre>
  
  <p>yields the following output.</p>
  
  <pre><code>user:dev_uid pass:dev_pwd host:127.0.0.1 database:dev_db
  </code></pre>
  
  <p>I can't access any of the entries by key name or load that string subsequent using the <code>yaml.load</code> method. </p>
  
  <pre><code>print(config['development']['user'])
  </code></pre>
  
  <p>This code yields the following error:</p>
  
  <pre><code>TypeError: string indices must be integers
  </code></pre>
  
  <p>Ideally I would like to end up with a parsing function that returns a dictionary or a <code>list</code> so I can access the properties by key name or using the <code>dot</code> operator like:</p>
  
  <pre><code>print(config['development']['user'])
  config.user
  </code></pre>
  
  <p>Where am I going wrong?</p>