Dec-24-2021, 07:33 PM
Hi,
The variable
The variable
The
Happy Holidays
The variable
ss
retains a scanned list of local routers. I don't know why mine is shown twice but, that's a question for a different forum. The variable
a
retains the rssi
of my first encountered router. The second is filtered out.The
for loop
expression is the typical ways of obtaining the same answer but, I'm not sure if it's correct even though I'm getting the same results.Happy Holidays
ss = [(b'', b'\x8e\xd8\x1b;\xc2J', 4, -36, 3, False), (b'myRouter', b'\x8a\xd8\x1b;\xc2J', 4, -36, 3, False), (b'vodafoneAA3YWA', b'\x08~d\xa0-`', 11, -59, 3, False), (b'', b'\x8e\xd8\x1b;\xc2>', 4, -71, 3, False), (b'myRouter', b'\x8a\xd8\x1b;\xc2>', 4, -72, 3, False), (b'VM', b'\xd4{\xb0\xab|\x12', 1, -75, 3, False), (b'vodafone2F78', b'\xa4\x08\xf5\xef/~', 1, -86, 4, False)] a = [x[3] for x in ss if x[0] == b'myRouter'][0] print(a) for x in ss: if x[0] == b'myRouter': print(x[3]) break