Useless python errors

I have a lot of code for my project and although it works it produces random errors which I don’t understand why they occur and they just annoy me. The code runs all the way through but it complains to me in the console window. The errors I am getting are mostly Unscriptable object(I’ve looked it up; trying to fix it now) and iteration over non-sequence. Whats up with these errors and how can I fix my code to get rid of them?

I looked at the code that you initially posted. You used “getSubjects()” right? Try using “getSubject()” for “Get” instead.

Maybe the list is returning something else which could be generating the error.

I don’t know, I never used message sensors that much, but it’s worth a try.

I’ve actually just ended up using a try-except block for the unscriptable object. I searched for it (which is why I changed my question) and found that it was sometimes trying to find the first element of an empty list. “getSubject()” gets the subject that the message sensor is filtering on; “getSubjects()” returns a list of all message subjects that have been recieved. My real problem now is with the other random errors.

“Iteration over non-sequence” sounds like a for loop is trying to run, but it’s not using an array or a range(). But that’s just my thoughts, I don’t know for sure.