Python中获取本机内网IP(Linux)
来源:互联网 发布:c语言字符输入输出函数 编辑:程序博客网 时间:2024/05/16 11:42
度娘搜出来的代码清一色的输出127.0.0.1。。。。。
还是谷歌靠谱,第一项就直接命中我的需求:D
def get_local_ip(ifname = 'eth0'): import socket, fcntl, struct s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) inet = fcntl.ioctl(s.fileno(), 0x8915, struct.pack('256s', ifname[:15])) ret = socket.inet_ntoa(inet[20:24]) return retprint get_local_ip()
- Python中获取本机内网IP(Linux)
- Python中获取本机内网IP(Linux)
- python 获取linux 本机IP地址
- python 获取本机ip
- Python获取本机外网IP
- 在Linux上利用python获取本机ip
- linux 获取本机IP
- Linux获取本机IP
- Linux获取本机IP
- linux获取本机ip
- Linux获取本机IP
- Linux获取本机ip
- linux 获取本机外网ip
- linux获取本机ip
- linux中获取本机ip和mac地址
- Linux Shell脚本中获取本机ip地址方法
- Linux Shell脚本中获取本机ip地址方法
- 如何获取本机内网和外网IP(windows+linux)
- 没有找到 framedyn.dll,因此这个应用程序未能启动。重新安装应用程序可能会修复此问题。
- webkit HTML5 WebSocket 综合分析 1
- 解决问题的思路
- linux下怎样彻底修改主机名
- rails3.1simple_captcha安装
- Python中获取本机内网IP(Linux)
- 转载:三个故事说穿了许多人
- ubuntu 下 软件的安装和卸载
- AT9260 GPIO中断
- tasklist、taskkill命令使用方法及应用实例讲解
- message from server: "Host is not allowed to connect to this MySQL server"解决办法
- android学习笔记33:自定义对话框
- NSString (大全)
- 计算机名言