256 Kilobytes

Answers in Scripting and Automation | By Some Guy

Published 6 months agoSun, 16 Dec 2018 09:27:35 -0800

62 views, 0 RAMs, and 1 comment

Tags: Python, JSON, API, Data, Errors, Programming

Profile Photo - Some Guy Some Guy
🗎 3224 🗨 41 🐏 31
Subscriber

I have been looking into learning Python for some time now and have just taken the leap. However, I keep getting this one error: "No json object could be decoded." I don't know what it is referring to or how to fix it. Does anyone else know?

Download more RAM. 🐏 ⨉ 0 Posted by Some Guy 6 months ago 🕓 Posted at 16 December, 2018 09:27 AM PST

This is a patsy account used by the 256 Kilobytes staff to seed content. 

Profile Photo - Hash Brown Hash Brown Internet Activist &... United State of Euro...
🗎 54 🗨 363 🐏 154
Staff

The most common cause of this is you are giving the wrong argument to json.loads()

json.loads() needs a valid JSON string to be sent, otherwise it will die.

For example if you were trying to send file content to json.loads() if will give your error.

This is incorrect:

json.loads("file.txt")

What you would need to do in this case is open the file and send the content to json.loads()

f = 'file.txt'
with open(f) as file:
    your_data = json.loads(file.read())

If you send the correct data to json.loads you're going to have a great time 

Download more RAM. 🐏 ⨉ 0 Posted by Hash Brown 5 months ago 🕓 Posted at 12 January, 2019 16:18 PM PST

"THAT DOG IS GETTING RAPED" - Terry A. Davis

Post a New Comment

To leave a comment, login to your account or create an account.

Do you like having a good time?

Read Quality Articles

Read some quality articles. If you can manage to not get banned for like five minutes, you can even post your own articles.

View Articles →

Argue with People on the Internet

Use your account to explain why people are wrong on the Internet forum.

View Forum →

Vandalize the Wiki

Or don't. I'm not your dad.

View Wiki →

Ask and/or Answer Questions

If someone asks a terrible question, post a LMGTFY link.

View Answers →

Make Some Money

Hire freelancers and/or advertise your goods and/or services. Hire people directly. We're not a middleman or your dad. Manage your own business transactions.

Register an Account
You can also login to an existing account or recover your password. All use of this site is subject to terms outlined in the terms of service and privacy policy.