title: how to read json embedded ini config file in python
body: <p>I'm using python 3.4 I have problem reading config file having json format in formatted way(i.e. not in same line.)
  my config file 'Example.config' goes like this</p>
  
  <pre><code>[ABC]
  
  outdoor = {'GAME':['cricket',
                      'football'],
             'INFO':[
                        {'Players':'eleven',
                         'Fun':'Unlimited'},
                        {'Players':'something',
                         'Fun':'Much_more'}
                       ]
           }
  
  [XYZ]
  
  INDOOR = {'GAME':['Carom'],
             'INFO':[
                          {'Players':'2','Fun':'Less'},
                          {'Players':'4','Fun':'More'}
                        ]
            }
  
  INDOOR1 = {'GAME':['TABLE-TENNIS',
                      'BASKETBALL',
                      'ANYTHING'],
            'INFO':[
                      {'Players':'TWO','Fun':'MORE'},
                      {'Players':'MORE','Fun':'MUCHMORE'}
                       ]
           }
  </code></pre>
  
  <p>mycode</p>
  
  <pre><code>config_parser=ConfigParser()
      config_parser.read('Example.config')
      for each_section in config_parser.sections():
          for option in config_parser.options(each_section):
              option=ast.literal_eval(option)
              try:
                  games=option['GAME']
                  info=option['INFO']
              except:
                  print('PLease format config same as qa_config.config file.Please Pay special attention to casing')
                  raise
  
              for game in games:
                  for eachInfo in info:
                      _INFO=eachInfo['Players']
                      _FUN=eachInfo['Fun']
                      print (each_section,':\n')
                      print ('\t',game,':\n')
                      print ('\t',_INFO,':\n')
                      print ('\t',_FUN,':\n')
  </code></pre>
  
  <p>Error :</p>
  
  <pre><code>option=ast.literal_eval(option)
    File "C:\Python34\lib\ast.py", line 84, in literal_eval
      return _convert(node_or_string)
    File "C:\Python34\lib\ast.py", line 83, in _convert
      raise ValueError('malformed node or string: ' + repr(node))
  ValueError: malformed node or string: &lt;_ast.Name object at 0x02E61910&gt;
  </code></pre>
  
  <p>If I keep dictionary in one line as string without any beautification in config file <code>ast.literal_eval()</code> is able to handle it.</p>
  
  <p>For example:</p>
  
  <pre><code>outdoor = {'GAME':['cricket','football'],'INFO':[{'Players':'eleven','Fun':'Unlimited'},{'Players':'something','Fun':'Much_more'}]}
  </code></pre>
  
  <p>So I guess this is due to tabs and spaces I'm using in config file. But I need beautification in config file as user will update it.</p>
  
  <p>I've also tried with <code>asteval</code> and <code>json.load</code>. T.I.A.</p>