Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python search in json file

def search(key, value, json_file):
    """
    Function that will  search in json file

    Args:
        key: key to search
        value: value to search
        json_file: the file to search

    Returns:

    """
    with open(json_file, 'r') as file:
        data = json.load(file)
        for item in data:
            if item[key] == value:
                return True
        return False
 
PREVIOUS NEXT
Tagged: #python #search #json #file
ADD COMMENT
Topic
Name
6+4 =