title: Convert Python dictionary to yaml
body: <p>I have a dictionary, I am converting dictionary to yaml using <code>yaml</code> module in python. But Yaml is not converting properly.</p>
  
  <pre><code>output_data = {
      'resources': [{
          'type': 'compute.v1.instance',
          'name': 'vm-created-by-deployment-manager',
          'properties': {
              'disks': [{
                  'deviceName': '$disks_deviceName$',
                  'boot': '$disks_boot$',
                  'initializeParams': {
                      'sourceImage': '$disks_initializeParams_sourceImage$'
                  },
                  'autoDelete': '$disks_autoDelete$',
                  'type': '$disks_type$'
              }],
              'machineType': '$machineType$',
              'zone': '$zone$',
              'networkInterfaces': [{
                  'network': '$networkInterfaces_network$'
              }]
          }
      }]
  }
  </code></pre>
  
  <p>I tried : </p>
  
  <pre><code>import yaml
  f = open('meta.yaml', 'w+')
  yaml.dump(output_data, f, allow_unicode=True)
  </code></pre>
  
  <p>I am getting <code>meta.yaml</code> file as following:</p>
  
  <pre><code>resources:
  - name: vm-created-by-deployment-manager
    properties:
      disks:
      - autoDelete: $disks_autoDelete$
        boot: $disks_boot$
        deviceName: $disks_deviceName$
        initializeParams: {sourceImage: $disks_initializeParams_sourceImage$}
        type: $disks_type$
      machineType: $machineType$
      networkInterfaces:
      - {network: $networkInterfaces_network$}
      zone: $zone$
    type: compute.v1.instance
  </code></pre>
  
  <p>Here, <code>{sourceImage: $disks_initializeParams_sourceImage$}</code> and <code>{network: $networkInterfaces_network$}</code> is getting like <code>dictionary</code>. <strong>It means inner 
   dictionary contents are not converting to yaml</strong>. </p>
  
  <p>I also tried, </p>
  
  <pre><code>output_data = eval(json.dumps(output_data)) 
  ff = open('meta.yaml', 'w+')
  yaml.dump(output_data, ff, allow_unicode=True)
  </code></pre>
  
  <p>But getting same <code>yaml</code> file content.</p>
  
  <p>How can I convert complete dictinary to yaml in Python?</p>