Hello all

I've been trying to make a connection of bluetooth with several mac addresses in a list, but it does not work. This is my code:

Code:
import appuifw, socket, e32
while 1:
    try:
        sock=socket.socket(socket.AF_BT,socket.SOCK_STREAM)
        mac_address= ['00:24:04:cb:f7:59', '00:02:76:fd:c4:3a']
        while True:
            for i in range (len(mac_address)):
                address2, services = bt_discover(mac_address[i])#find services and port number
                if 'Server' in services:
                    channel = services[u'Server']
                #while (str(address2) == '00:24:04:cb:f7:59'):
                    target = (address2, channel)
                    sock.connect(target)
                    print "Found Server"
                    e32.ao_sleep(3)
                else:
                   appuifw.note(u"Target is not running a btchat server","error")
    except:
        #appuifw.note(u"Connection lost", "info")
        print "not found..."
        pass
I would like to have a saved mac addresses inside a list, then inside a while it will try one mac address at a time and try to connect.
I would like also to be able to do a scan, then save the mac addresses in a list without having to see the list that pops out when using bt.discover()

Thank you