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 = ?", (name,))
numbers = cursor.fetchone()[0]
print numbers
atomicnumber = numbers
cursor= self.conn.execute("SELECT MOL_NUMBER FROM LINK where ELEMENT_NUMBER = ?", (atomicnumber,))
mnumbers = cursor.fetchall()
print mnumbers
mnum_list = []
for i in mnumbers:
mnum_list.append(i[0])
print mnum_list