python3 獲取本地 ip 和當前主機外網 ip 地址
獲取本地機器出口外網 ip 地址 def get_out_ip(): url = r'http://2019.ip138.com/ic.asp' r = requests.get(url) txt = r.text ip = txt[txt.find ...
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 推薦指數:
獲取本地機器出口外網 ip 地址 def get_out_ip(): url = r'http://2019.ip138.com/ic.asp' r = requests.get(url) txt = r.text ip = txt[txt.find ...
下面這個方法是獲取客戶端請求地址 ...
用法: ...
方法一: 借助uuid模塊 import uuid def get_mac_address(): node = uuid.getnode() mac = uuid.UUID(int = node).hex[-12:] return mac 方法 ...
一、不帶參數 #!/usr/bin/python # -*- coding: UTF-8 -*- import os def get_ip(): #注意外圍使用雙引號而非單引號,並且假設默認是第一個網卡,特殊環境請適當修改代碼 out = os.popen ...