This is my first question here, so I thank everyone in advance for your patience...
I am trying to understand the solution with JSONDecoder for this question, and to learn at the same time how does raw_decode work.
From the documentation:
raw_decode(s)
Decode a JSON document from s (a str beginning with a JSON document) and return a 2-tuple of the Python representation and the index in s where the document ended.
This can be used to decode a JSON document from a string that may have extraneous data at the end.
I have a string beginning with a JSON document:
text = '{"param1":"1","param2":"2"} some other text'
And I'm trying to get from it a JSON document:
result, index = json.JSONDecoder.raw_decode(text)
Get
TypeError: raw_decode() missing 1 required positional argument: 's'
What am I missing? Where do I get it wrong? Thanks in advance for the answers!