The important thing in life is to have a great aim , and the determination

常用链接

统计

IT技术链接

保险相关

友情链接

基金知识

生活相关

最新评论

在python中获取mac和ip地址

python 获得本机MAC地址:
import uuid
     def get_mac_address():
     mac=uuid.UUID(int=uuid.getnode()).hex[-12:]
     return ":".join([mac[e:e+2] for e in range(0,11,2)])


python获取IP的方法:使用socket

import socket

myname=socket.getfqdn(socket.gethostname( ))
    myaddr=socket.gethostbyname(myname)
    print(myname)
    print(myaddr)

posted on 2017-05-15 23:26 鸿雁 阅读(234) 评论(0)  编辑  收藏 所属分类: IT技术相关


只有注册用户登录后才能发表评论。


网站导航: