Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def filter_list_entries(path: str, tags: list):
- """
- Parameters
- ----------
- path : str
- path to json file like {"bl_townhall_lvl1.png": {"path": "bl_townhall_lvl1.png", "tags": ["tag"]}, ... }
- Returns
- -------
- list
- list of files with given tags
- """
- with open(path, 'r') as read_file:
- return [ value['path'] for key, value in json.load(read_file).items() if all(tag in value['tags'] for tag in tags) ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement