Python - Parsing Json format input
Question: I need to make a data parsing that come from another program in JSON format:

    
    
    import json
    
    input = '''
    Array
    (
        [error] => Array
            (
            )
        [result] => Array
            (
                [0] => Person Object
                    (
                        [arr:Person:private] => Array
                            (
                                [cf] => DRGMRO75P03G273O
                                [first_name] => Mario
                                [last_name] => Dragoni
                                [email] => mario.dragoni@yahoo.com
                                [phone] => 558723
                                [uid] => dragom
                                [source] => USRDATA
                            ) 
                    )
                )
            )
    '''
    

I tried:

    
    
    data = json.loads(input)
    

But I get:

    
    
    **ValueError:** No JSON object could be decoded
    

Perhaps the fault is due to lack of field separators?

Edit:

The input was generated by a _php_ **print_r** , I replaced it with
**json_encode**


Answer: your function is correct.

but the provided json string is wrong

in fact the input is a mixed array and class object

you can import json in python like this:

    
    
    import json
    j = json.loads('{"one" : "1", "two" : "2", "three" : "3"}')
    print j['two']
    

