This is my code hierachy
2048/
├── data
│ └── numbers.json
├── data
│ └── draw.py
└── main.py
from pathlib import Path
path = Path('/data/numbers.json')
with open(path, "w") as numbers:
numList = json.load(numbers)
I tried using the above code to get a list but keep receiving this error
FileNotFoundError
[Errno 2] No such file or directory: '\data\numbers.json'
File "C:UsersGarfielddesktopCodingPython2048srcdraw.py", line 5, in <module>
with open(path, "w") as numbers:
^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '\data\numbers.json'