原文:python3獲取本地MAC地址

import uuid def get mac address : mac uuid.UUID int uuid.getnode .hex : return : .join mac e:e for e in range , , ...

2017-06-26 14:04 0 1263 推薦指數:

查看詳情

python獲取mac地址的方法

方法一:   借助uuid模塊 import uuid def get_mac_address():   node = uuid.getnode()   mac = uuid.UUID(int = node).hex[-12:]  return mac 方法 ...

Tue Jun 04 00:54:00 CST 2019 0 2891
linux python3獲取ip地址

一、不帶參數 #!/usr/bin/python # -*- coding: UTF-8 -*- import os def get_ip(): #注意外圍使用雙引號而非單引號,並且假設默認是第一個網卡,特殊環境請適當修改代碼 out = os.popen ...

Tue Jan 09 22:22:00 CST 2018 0 3380
 
粵ICP備18138465號   © 2018-2026 CODEPRJ.COM