SHOW:
|
|
- or go back to the newest paste.
1 | - | def OnClick(self, event): |
1 | + | |
2 | - | name = event.GetEventObject().GetLabelText() |
2 | + | def OnClick(self, event): |
3 | name = event.GetEventObject().GetLabelText() | |
4 | - | cursor= self.conn.execute("SELECT * FROM ELEMENT where SYMBOL==?", [name]) |
4 | + | |
5 | cursor= self.conn.execute("SELECT * FROM ELEMENT where SYMBOL==?", [name]) | |
6 | - | elements = cursor.fetchall() |
6 | + | |
7 | elements = cursor.fetchall() | |
8 | - | print elements |
8 | + | |
9 | print elements | |
10 | - | cursor= self.conn.execute("SELECT ATOMIC_NUMBER FROM ELEMENT where SYMBOL = ?", [name]) |
10 | + | |
11 | cursor= self.conn.execute("SELECT ATOMIC_NUMBER FROM ELEMENT where SYMBOL = ?", [name]) | |
12 | - | numbers = cursor.fetchall() |
12 | + | |
13 | numbers = cursor.fetchall() | |
14 | - | print numbers |
14 | + | |
15 | - | atomicnumber = numbers[0][0] |
15 | + | print numbers |
16 | atomicnumber = numbers[0][0] | |
17 | - | cursor= self.conn.execute("SELECT MOL_NUMBER FROM LINK where ELEMENT_NUMBER = ?", [atomicnumber]) |
17 | + | |
18 | cursor= self.conn.execute("SELECT MOL_NUMBER FROM LINK where ELEMENT_NUMBER = ?", [atomicnumber]) | |
19 | - | mnumbers = cursor.fetchall() |
19 | + | |
20 | - | print mnumbers |
20 | + | mnumbers = cursor.fetchall() |
21 | - | combinations = atomicnumber[0][0] |
21 | + | print mnumbers |
22 | - | def intersect (*combination ): |
22 | + | combinations = atomicnumber[0][0] |
23 | - | sets = iter(map(set, combinations)) |
23 | + | def intersect (*combination ): |
24 | - | result = st.next() |
24 | + | sets = iter(map(set, combinations)) |
25 | - | for s in sets: |
25 | + | result = st.next() |
26 | - | results = result.intersection (s) |
26 | + | for s in sets: |
27 | - | return result |
27 | + | results = result.intersection (s) |
28 | return result |