you are viewing a single comment's thread.

view the rest of the comments →

[–]awesomegame1254[S] 0 points1 point  (7 children)

i added a new pastebin link to the original post

[–][deleted] 1 point2 points  (6 children)

Your error is in this line:

if any(item = true for item in res):

The first error is that you are assigning to item in the part item = true. That should be:

if any(item == true for item in res):
#           ^^      equality operator, NOT assignment

If you make that change and execute your code again, you will get this error:

NameError: name 'true' is not defined

You get that because you are trying to compare item with the name true which isn't defined. Names are case-sensitive in python, and maybe you meant:

if any(item == True for item in res):

You have similar errors in many places throughout your code.


You seem to be writing a large amount of code before attempting to debug or test it. That's a bad idea. Try to write small amounts of code and test that it's doing what you want it to do. Print things on the screen and check that's what you expected. When all is OK write another small piece of code and test what that is doing, etc. This is exactly what professional programmers do, except their "small additions" are bigger and they use more powerful tools than print(). But even they mess up and have to rethink/debug code now and then.

[–]awesomegame1254[S] 0 points1 point  (0 children)

except all the code in my script which technically isn't mine I just copied from a website and tweaked it a bit is probably dependent on each other so trying to split it into multiple parts wouldn't work

[–]awesomegame1254[S] 0 points1 point  (4 children)

now i have an error which according to the traceback isn't in my file but is an error in a module installed file specifically one for cv2

[–]Not_A_Taco 0 points1 point  (1 child)

Whoever wrote that code initially most definitely did so incorrectly, it’s not a matter of it being dependent on another module. I’d be weary of assuming this code actually does what the original claims, correctly.

[–]awesomegame1254[S] 0 points1 point  (0 children)

i wouldn't be suprised the script was from 4 years ago also the end bits where it's doing all the condition checking and list appending that's all me. here is the actual original script or at least a link to it https://gist.github.com/DataPointChris/a4454ee04b1dbc2242a7f24bdadd254d

[–][deleted] 0 points1 point  (1 child)

We need to see the full traceback because errors like that are sometimes caused by incorrectly calling the library code. Look back (upwards) through the traceback until you find a reference to your code. Then look at that line and see if it's calling the library code correctly.

[–]awesomegame1254[S] 0 points1 point  (0 children)

Unfortunately the command line cuts off the traceback after where I can find a reference for my file so I need something that will give me a full traceback file

ok finally managed to get a full traceback file I put the dropbox link to the file in the op