1. 以前一直用ipconfig来查看ip地址,哈哈哈,现在发现挺好玩
#获取本机的IP地址和mac地址 import uuid import socket def get_mac_address(): mac=uuid.UUID(int = uuid.getnode()).hex[-12:] #print(mac) return ":".join([mac[e:e+2] for e in range(0,11,2)]) #range(0,11,2):在[0:11]取值,间隔为2 def get_ip_address(): host_name = socket.getfqdn(socket.gethostname()) ip_address = socket.gethostbyname(host_name) return host_name, ip_address if __name__ == '__main__': mac_address = get_mac_address() print('the mac address is: '+mac_address) ip_address = get_ip_address() print('the host name is: '+ip_address[0]) print('the ip address is: '+ip_address[1])
2. adb查看手机设备信息,参考:https://blog.csdn.net/weixin_43927138/article/details/90477966,https://www.jianshu.com/p/7c0a6da594c8
参考:
https://www.cnblogs.com/chenjingyi/p/5741742.html
##记录笔记
参与评论
手机查看
返回顶部