ringzero's recent timeline updates
看看时间轴是怎么设计的?学习一下。
Oct 5, 2015
扔一些鸡蛋在这里。
Oct 5, 2015
ringzero

ringzero

V2EX member #40977, joined on 2013-06-21 10:54:49 +08:00
ringzero's recent replies
先把 str 强转成精度高的 float 类型,做 try catch 捕捉住 ValueError 错误
然后用 float.is_integer()来判断数字是否是整形,解决的办法还是笨。
@hwsdien
恩,尝试过这种方法, 要强转之后,才能判断,默认传过去的是 str 类型

a = '3.14'
print isinstance(a, float)
False
print isinstance(float(a), float)
True
最终想要的结果,给出参数,得出数据类型路径

```python
c = '/buy/12333/price/2.00'
structure = '/str/int/str/float'
```
Apr 5, 2016
Replied to a topic by aldnoah 信息安全 听说学信网被脱裤啦~
接近 380 个压缩文件
http://weibo.com/1859213130/DpwGm91Bc
@mulog 拉赫
这种文章适合投稿到: http://drops.wooyun.org/
Feb 14, 2016
Replied to a topic by yuntong Python Django 如何实现调度系统?
Django + ThreadPoolExecutor
Feb 14, 2016
Replied to a topic by Livid Python requests-futures
Jan 1, 2016
Replied to a topic by hellogbk 程序员 初学 Python,此函数求优化
def ip2num(ip):
ip = [int(x) for x in ip.split('.')]
return ip[0] << 24 | ip[1] << 16 | ip[2] << 8 | ip[3]

def num2ip(num):
return '%s.%s.%s.%s' % (
(num & 0xff000000) >> 24,
(num & 0x00ff0000) >> 16,
(num & 0x0000ff00) >> 8,
num & 0x000000ff
)

def gen_ips(start, end):
"""生成 IP 地址"""
# if num & 0xff 过滤掉 最后一段为 0 的 IP
return [num2ip(num) for num in range(start, end + 1) if num & 0xff]
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3448 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 20ms · UTC 12:03 · PVG 20:03 · LAX 05:03 · JFK 08:03
♥ Do have faith in what you're doing.