python2.7_1.3_获取远程设备的IP地址
2016-01-28 16:54
579 查看
代码如下:
# -*- coding: utf-8 -*- import socket def get_remote_machine_info(): remote_host = 'www.python.org' try: print 'IP address:%s' % socket.gethostbyname(remote_host) except socket.error, err_msg: print '%s:%s' % (remote_host, err_msg) if __name__ == '__main__': get_remote_machine_info()
相关文章推荐
- Python集合set与frozenset的区别
- python2.7_1.2_打印设备名和IPv4地址
- Python渗透测试工具合集
- python自动化运维 第1章系统基础信息详解 第一节
- Python 练手程序合集(一)
- python中的单引号,双引号和三双引号的区别
- python天气预报
- python2.7_1.14_编写一个简单的回显客户端/服务器应用
- java和python的SHA-1形式RSA加密方式代码互通
- ubuntu下python3.4安装numpy
- python3 mail
- python wsgi 详解浏览器请求过程
- 解决yum升级的问题“There was a problem importing one of the Python modules”
- Python 高级特性 : 生成器
- 【python】'''用法
- 用python实现算法之——插入排序
- python 打印类的属性、方法
- Black Hat python-1.x
- Python Panda - 学习笔记
- 条形码识别(2)——获取条形码条空(bar&space)宽度