Skip to content

Instantly share code, notes, and snippets.

@cupofcodeblog
Created March 16, 2024 20:48
Spotify API - read file - empty file
def from_file_to_json_obj(file_path):
if Path(file_path).exists():
f = open(file_path)
json_obj = json.load(f)
f.close()
return json_obj
return {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment