Click here to Skip to main content
15,890,579 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
How to read single value from a JSON file and store it in temp variable in python?

What I have tried:

I am new to this and would be helpful if sample code is shared
Posted
Updated 7-May-17 23:01pm

1 solution

You need to look for a JSON library in Python language, that would let you serialize and deserialize the JSON strings, to runtime objects.

If you're using Python 2, consider the following,
18.2. json — JSON encoder and decoder — Python 2.7.13 documentation[^]. There is a sample demonstration of the package available on that page that you can use for your own project. There are encoders and decoders specified there, that you are interested in.

Once decoded from string, to an object, you can fetch the value of that property. Go through that link to learn more.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900