0
I was able to filter the items I want, but they are in a kind of column.
I did it that way:
import os
cmd = os.popen('arping -I enp1s0 -c 2 192.168.0.1')
arr = cmd.read().split('\n')
for line in arr:
if 'Unicast' in line:
a = line.split()
b = a[4]
c = b[1:18]
print c
The result of print c
, is the IP MAC address, in which case it goes out that way.
Example:
AA:BB:CC:DD:EE:00
AA:BB:CC:DD:EE:00
AA:BB:CC:DD:EE:01
How can I take, for example, all the content that is on the bottom line, like line 1, 2 or 3. Like I want to pick up AA:BB:CC:DD:EE:01
and put it into a variable.
It wasn’t clear what you want to do. What exactly would "pick up the bottom line content"? Down from what? What lines?
– Woss