python - Does converting json to dict with eval a good choice? -


I am getting a Jason object from a remote server, and converting it into a string string like this:

  A = eval (feedback)   

Is it stupid in any way, or do I have a better option?

  1. JSON isn ' true , < Due to code> false , and null also does not have valid python.

  2. The Python code will be executed for eval , so you can come to the mercy of the malicious injection of code.

    json is available in the standard library instead of the module:

      import json data = json.loads ( "[1, 2, 3]")   

    Using a version of older Python than 2.6, you have to download the module. It is called simplejson and may be.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -