this is what I'm tryting now
but I'm having problems
can you take a look , please?
and also what do you mean be set()?
Thanks,
but I'm having problems
can you take a look , please?
import pexpect import datetime import time child = pexpect.spawn("bluetoothctl") child.send("scan on\n") SendToServer = [] try: print("Scan Begin") while True: now = datetime.datetime.now() future = (now+ 10) #####--->this is not wroking##### child.expect("Device (([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})) RSSI: (-[0-9]{2})",timeout=None) bdaddr = child.match.group(1) bdrssi = child.match.group(4) DeviceInfo = ((bdaddr + b'!' + bdrssi)) print(DeviceInfo) SendToServer.append(DeviceInfo) if now>future:#### --->this is also not working also obvious :-) #### print("it's been 10 seconds" + now) ##cdoe for sending to server, need to write print ("Old size is - " + len(SendToServer)) SendToServer.clear() print ("Ne size need to be 0" + len(SendToServer)) break except KeyboardInterrupt: child.close()
and also what do you mean be set()?
Thanks,