擅长:python、mysql、java
<pre><code>#Open the file and make a list of tuples [(ip1, mac1), (ip2, mac2)..]
txt_file = open("text.txt", "r")
x = [x.rstrip().split() for x in file.readlines()]
#now make a dictionary where key = ip, v = MAC
dict_ = {k: v for k, v in x}
# You now have a dictionary where you can get the MAC from ip via
>>>dict_['ip address']
>>>MAC
</code></pre>
<p>希望有帮助</p>