(file_path)
| 12 | |
| 13 | |
| 14 | def access_data(file_path): |
| 15 | try: |
| 16 | with open(file_path, 'r') as file: |
| 17 | return json.load(file) |
| 18 | except FileNotFoundError: |
| 19 | print(f"Error: !!Oops... I guess you missed to keep things in same folder!!") |
| 20 | return {} |
| 21 | except json.JSONDecodeError: |
| 22 | print(f"Error: !!Oops... I think I am old i cant decode this file is it really json file you programi...!!") |
| 23 | return {} |
| 24 | |
| 25 | |
| 26 |