system.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:ahenk 作者: Pardus-LiderAhenk 项目源码 文件源码
def ip_addresses():
            arr = []
            for iface in psutil.net_io_counters(pernic=True):
                ip = psutil.net_if_addrs()[str(iface)][0][1]
                if re.match(r'^((\d{1,2}|1\d{2}|2[0-4]\d|25[0-5])\.){3}(\d{1,2}|1\d{2}|2[0-4]\d|25[0-5])$', ip) and str(
                        ip) != 'localhost' and str(ip) != '127.0.0.1':
                    arr.append(ip)
            return arr
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号