-2

Overview

My group has built hardware that needs to communicate with software that we're supposed to write. However we all are at a standstill because we can't figure this issue out. We have searched a lot but to no avail. We would love ANY help.

This is the GUI we're supposed to use and as help to our final part we have to code an Add feature so you can choose several variables instead of all or one, which is the case now. As you see the Add button is there, but it has no functionality currently.

https://i.stack.imgur.com/VWLFX.png

What we need to code

We need the Add button, to add whatever is chosen in the dropdown menu and shown in the textbox for any amount of items.

We tried to do

list_name.append(varible_name)

But it returns the error

TypeError: descriptor 'append' requires a 'list' but got a 'instance'

We did try with other code after googling but at this point I nor my partners can remeber any of them.

I will not post our code, since some of the info is sensitive(the rest of the gui which is cropped out) - but i don't need to. Any arbitrary names of each component is fine - we will work on it from there to implement it to our code. Everything works except the Add, so there are no other errors in the code.

I hope the info is sufficient enough to understand the issue fully.

e_phed
  • 21
  • 3

1 Answers1

1

You have assigned the list class to list_name.

class Foo: pass

f = Foo()
list_name = list   # whoops!  should be list() 
list_name.append(f)

Gives

TypeError: descriptor 'append' requires a 'list' object but received a 'instance'
Steven Rumbalski
  • 44,786
  • 9
  • 89
  • 119