I am getting data from database and storing it in a list called relays. this list currently looks like this:
relay: [(4, '26', '19'), (5, '13', '6')]
the first number of each item is the id number I use through out the code. the second two are numbers GPIO pins .
I want a away to reference the list item by it's first number so for instance variable[5][1] which would return 13. so to turn on this GPO pin I can just run something like:
GPIO.output(variable[5][1], True)
GPIO.output(variable[4][2], True)
Is this possible? (sorry if this is a stupid question, I am new to python)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…