I have made my own JSON file:
CuttingData.json (1001 Bytes)
And I am trying to open it with this piece of code:
import json
with open('CuttingData.json') as data_file:
data = json.load(data_file)
print(data)
I am getting this error in VS-Code:
Traceback (most recent call last):
File "beamer.py", line 4, in <module>
data = json.load(data_file)
File "C:\Users\Mick\Anaconda3\lib\json\__init__.py", line 299, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "C:\Users\Mick\Anaconda3\lib\json\__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "C:\Users\Mick\Anaconda3\lib\json\decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\Mick\Anaconda3\lib\json\decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
I have tested my piece of code with this JSON file:
test.json (307 Bytes)
And that works.
What am i doing wrong, thank you for helping me!