Created
June 14, 2021 16:52
-
-
Save iloveicedgreentea/62ceb47b6796b0b7742f8b9b96776fd1 to your computer and use it in GitHub Desktop.
Read json data - python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
# Read a file and get some value if it is false | |
with open("test.json", 'r') as file: | |
json_input = json.loads(file.read()) | |
for i, val in enumerate(json_input["somelist"]): | |
if val is False: | |
print(f"{i}: False") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment