代码

# -*- coding: utf-8 -*-
import psutil
#获取网卡名称和其ip地址,不包括回环
def get_netcard():
netcard_info = []
info = psutil.net_if_addrs()
for k,v in info.items():
for item in v:
if item[0] == 2 and not item[1]=='127.0.0.1':
netcard_info.append((k,item[1]))
return netcard_info
if __name__ == '__main__':
print get_netcard()

最新文章

  1. JQuery中ajax的相关方法总结
  2. 窗口activity
  3. Uva 110 - Meta-Loopless Sorts(!循环,回溯!)
  4. pandas 修改 DataFrame 列名
  5. String作为方法参数传递 与 引用传递
  6. IOS学习感想
  7. Spring 使用外部部署文件
  8. 【转】ubuntu打包压缩命令总结
  9. selenium webdriver python 环境搭建
  10. w3wp.exe CPU过百问题
  11. 对scrapy经典框架爬虫原理的理解
  12. Windows Server 2016-Hyper-V网络虚拟化概述
  13. 关于config文件中AppSettings和ConnectionStrings的用法跟区别(转)
  14. PAT B1013
  15. BZOJ 3687: 简单题 bitset
  16. scipy的一些函数名
  17. [note]What I’ve learnt from working on startups
  18. git commit 多行注释方法说明
  19. 演示一个简单的Redis队列
  20. 阿里云服务主机部署Thinkphp系统错误解决方案

热门文章

  1. pyharm 上运行 npm 配置方法
  2. 61、springmvc-异步请求-返回DeferredResult
  3. Vue动态创建注册component的实例代码
  4. win32窗口程序分析
  5. 跟随一条insert语句, 进入TiDB的源码世界(上)
  6. Java链接Redis时出现 “ERR Client sent AUTH, but no password is set”
  7. 点分 TREE
  8. docker 部署nestjs应用
  9. Educational Codeforces Round 49 (Rated for Div. 2)
  10. windows2008服务器设置系统启动时程序自动运行