On 07/04/17 20:21, Phil wrote: > After a bit more thought I now realise that I just > need to use self to reference e[][] in my check function.
You need to use self any time you access any member of your class. So in your case: class TestGUI: def __init__(self, master): self.master = master ... self.e = [[None] * num_cols for _ in range(num_rows)] ... self.check_button = Button(master,text="Check", command=self.check) ... def check(self,array): ... The following attributes all need to be prefixed with self any time you access them: self.master self.e self.check_button self.check In this specific case you only need to use self.e HTH -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor