Skip to content

Instantly share code, notes, and snippets.

@iloveicedgreentea
Created June 14, 2021 16:52

Revisions

  1. iloveicedgreentea created this gist Jun 14, 2021.
    9 changes: 9 additions & 0 deletions blog_py_read_json.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    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")