python 获取公网 ip
- from urllib2 import urlopen
- my_ip = urlopen('http://ip.42.pl/raw').read()
- print 'ip.42.pl', my_ip
- from json import load
- from urllib2 import urlopen
- my_ip = load(urlopen('http://jsonip.com'))['ip']
- print 'jsonip.com', my_ip
- from json import load
- from urllib2 import urlopen
- my_ip = load(urlopen('http://httpbin.org/ip'))['origin']
- print 'httpbin.org', my_ip
- from json import load
- from urllib2 import urlopen
- my_ip = load(urlopen('https://api.ipify.org/?format=json'))['ip']
python 获取公网 ip的更多相关文章
- python获取公网ip,本地ip及所在国家城市等相关信息收藏
python获取公网ip的几种方式 from urllib2 import urlopen my_ip = urlopen('http://ip.42.pl/raw').read() ...
- python获取公网ip的几种方式
python获取公网ip的几种方式 转 https://blog.csdn.net/conquerwave/article/details/77666226 from urllib2 import u ...
- Python 之自动获取公网IP
Python 之自动获取公网IP 2017年9月30日 文档下载:https://wenku.baidu.com/view/ff40aef7f021dd36a32d7375a417866fb84ac0 ...
- C#联机获取公网IP
C#获取IP的方式有很多种,这里通过http://www.ipip.net/这个稳定的在线IP库的来获取公网IP. string tempip = "0.0.0.0"; WebRe ...
- Delphi获取公网IP地址函数
uses IdHTTP; function GetPublicIP: string; var strIP, URL: string; iStart, iEnd: Integer; MyIdHTTP: ...
- 获取本地ip和获取公网ip
import socket def get_local_ip(): ''' 获取本地ip地址 :return: ''' s = socket.socket(socket.AF_INET, socket ...
- JAVA获取公网ip
在ipv4地址稀缺的今天,分配到公网ip几乎是不可能的,但是我拨号之后的ip竟然是公网IP. 将自己的电脑作为服务器·,做点好玩的程序,就成为了可能. 由于运营商的ip是动态分配的公网ip的所以就需要 ...
- python 获取自身ip
原文 见过很多获取服务器本地IP的代码,个人觉得都不是很好,例如以下这些 不推荐:靠猜测去获取本地IP方法 #!/usr/bin/env python # -*- coding: utf-8 -*- ...
- Linux系统curl获取公网ip
收集了几个查询当前公网ip的网址,可以通过curl命令方便的查看 curl cip.cc curl ipinfo.io curl myip.ipip.net curl http://members.3 ...
随机推荐
- IntelliJ IDEA更换主题样式分享
原文地址:https://blog.csdn.net/liu865033503/article/details/79481785 .自定义主题样式网址:http://www.riaway.com/in ...
- SSL和TLS漏洞验证
工具下载:git clone https://github.com/drwetter/testssl.sh.git 实验环境:192.168.1.22(bee-box v1.6) 192.168.1. ...
- 帝国cms学习
手册地址1 手册地址2 入门 安装: 将下载的upload里的文件上传到网站更目录 然后 域名/e/install/index.php Warning: Use of undefined consta ...
- Foundation框架系列-NSArray
NSArray常用API 数组字符串指定字符拼接 // 将数组中的元素以separator拼接返回字符串 比如@[@"a=1", @"b=2"] 以separa ...
- MySQL的xml中对大于,小于,等于的处理转换
原符号 < <= > >= & ' " 替换符号 < <= > >= & ...
- Linux 下 Nand Flash 驱动说明
注册 driver_register 通过 module_init(s3c2410_nand_init);注册 Nand Flash 驱动. 在 s3c2410_nand_init ()中通过 dri ...
- javascript特效源码(2、图像特效)
1.不停闪烁的图像 不停闪烁的图片[修改显示的图片及链接地址后根据说明进行共1步] 1.以下代码放在一个新建页面的HTML的<body></body> 区即可:[页面上必须什么 ...
- rsyslog 服务器重启后 发现不能接受到外部日志 只能接受本地日志 关闭防火墙即可
rsyslog 服务器重启后 发现不能接受到外部日志 只能接受本地日志 关闭防火墙即可 1 关闭防火墙: # systemctl stop firewalld 2 将SELINUX设置为disabl ...
- 解决element 分页组件,搜索过后current-page 绑定的数据变了,但是页面当前页码并没有变的问题
前言上一篇写前台解决分页问题的时候没有这个问题,但是在实际项目后台中有遇到过,所以在这里专门说一下,如果参考前台分页出现这种问题了,也可以使用这种方法!bug:vue和element实现的后台分页,当 ...
- PostgreSQL问题解决--连接数过多
I am trying to connect to a Postgresql database, I am getting the following Error: Error:org.postgre ...