Following this post, I used the following code:
with open(mytextFile) as f:
nestedList = json.load(f)
print(nestedList)
my textfile consists of [[i,1],[i,2]]
only. When I run the above code, I get the error:
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 3 (char 2)
I have tried both with adding and removing the option encoding='utf-8', also with files with other extensions than txt. The same error occurs all the time.
Could you help please?
Edit: If this is not the right way to read nested lists from a file, could you point me to the right direction?