Skip to content

AttributeError: 'list' object has no attribute 'contains'  #3651

@meuwl

Description

@meuwl

I know, that this error was discussed and closed already, but I can't solve it anyway. (@peircej)

This error message came up during the workshop when a participant running PsychoPy 2021.1 tried to create a clickable button without using the button component (the old `method). (@mdcutone)

That's my error message:

`Traceback (most recent call last):
File "C:\Users\Admin\Desktop\posner\test_lastrun.py", line 157, in
if obj.contains(mouse):
AttributeError: 'list' object has no attribute 'contains'

Experiment ended. #####`

In my case there is only one picture ("image") and one click ("mouse"), but the code still crushes right after first click at any part of screen. I can't code at all and I dont know english good enough to search through pythons' forums so I'm asking for help. If it's possible, describe anything in easy words.

Thanks a lot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions