From the course: Python Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

JSON

JSON

- [Instructor] Previously, we've been focusing a lot on reading and writing files to and from the disk. JSON files with the .json extension are common, of course, and you might regularly be working with them. But for now, we'll mostly be focusing with JSON strings. I'm going to assume by this point that you're pretty good at reading files from the disk. You can load their contents into a string and now you find yourself with a JSON string. So what do you do? Well, let's make a JSON string, a is apple, b is bear, c is cat. Okay. Something to keep in mind, JSON is not Python. This JSON formatted string looks a lot like a Python dictionary, but it's not. It's a string. I've seen a lot of even very experienced programmers get confused about this and lose track of what they're working with. This is a string that just happens to be in the JSON format. And in order to turn it into a dictionary, we need to import the JSON…

Contents