M
M
Matvey2021-12-14 17:42:19
Python
Matvey, 2021-12-14 17:42:19

How to fix json.decoder.JSONDecodeError: Expecting value: line 1 column 8 (char 7) error?

How to fix json.decoder.JSONDecodeError: Expecting value: line 1 column 8 (char 7) error?
There is a txt file that says [3, 3, 'Bot']
And the script:

with open('text.txt', 'r', encoding="utf-8") as f:
        text = f.read()
        items = json.loads(text)

For some reason it throws an error

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-12-14
@mlt_melt

In JSON, a string is denoted by a double quote, not a single quote

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question