How to define a global list in python and append local list to it
问题 I want to define a global list and append a list to it. I am getting a list (i[0]) by some on click event and appended that to mnum_list. Now i want create a global list and append that mnum_list to it. Any idea how to do this? def OnClick(self, event): name = event.GetEventObject().GetLabelText() cursor= self.conn.execute("SELECT * FROM ELEMENT where SYMBOL==?", (name,)) elements = cursor.fetchall() print elements cursor= self.conn.execute("SELECT ATOMIC_NUMBER FROM ELEMENT where SYMBOL = ?"