-2
我想獲取macaddress; 執行驗證可以識別(或個人電腦)個人誰啓動瀏覽器, 我不能這樣做;請幫幫我!關於django macaddress
這是我的views.py:
import commands
import struct
import uuid
def getmac(iface):
ifconfig = commands.getoutput("ifconfig " + iface + "| grep HWaddr | awk '{ print $5 }'").strip()
if len(ifconfig) == 0:
getmac = 'Mac not found'
else:
getmac = ifconfig[:17]
return getmac