LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   python: AttributeError: 'list' object has no attribute 'Append' (https://www.linuxquestions.org/questions/programming-9/python-attributeerror-list-object-has-no-attribute-append-696680/)

browny_amiga 01-12-2009 04:47 AM

python: AttributeError: 'list' object has no attribute 'Append'
 
Hi

I am working on a Wxpython application, where I create buttons and then want to destroy all the buttons again, so I can display others (like in a main menu)
To keep track of what objects have to be destroy()ed, I want to add them to a list:

code:
----------------

self.term_list = []

self.chords_button = wx.Button(self.panel, label="Train Chords")
self.Bind(wx.EVT_BUTTON, self.chords, self.chords_button)

self.term_list.Append(self.chords_button)


On this, Python drops the error,

AttributeError: 'list' object has no attribute 'Append'


which does not make sense, because lists always has a append attribute, right?

Stumped...

Markus

taylor_venable 01-12-2009 04:49 AM

Right, no "Append" but "append". Case-sensitive.

browny_amiga 01-12-2009 04:56 AM

blast, you are right!!

Did I miss something here? I thought python is case insensitive?
Or only certain things are case sensivite?


Markus

taylor_venable 01-12-2009 04:58 AM

No, I think it's all case-sensitive. :) Most programming languages nowadays are.

There aren't Java-like restrictions on how you name classes and modules, though.


All times are GMT -5. The time now is 04:08 PM.