irosyking's recent timeline updates
irosyking

irosyking

V2EX member #78622, joined on 2014-10-26 11:56:41 +08:00
Today's activity rank 10766
irosyking's recent replies
中产家庭 /左右不逢源
Jul 20, 2020
Replied to a topic by kaiser1992 Python [求教] 协程与 IO 多路复用区别?
1 、Async IO Framework = eventloop + non-blocking sockets + coroutines
Async IO Framework = eventloop + non-blocking sockets + callbacks

2 、Coroutine = Future + Task + Generator
Lazy computation = Generator
分母+1
Sep 29, 2017
Replied to a topic by lzjun 推广 赠书啦《 Python 网络数据采集》
89
Mar 29, 2015
Replied to a topic by pi1ot Python 有喜欢 Python 的没
好隐秘的招聘方式
Nov 17, 2014
Replied to a topic by dbas Python python 字符串转字典问题
Nov 17, 2014
Replied to a topic by dbas Python python 字符串转字典问题
写的不够好,你看一下

import re

s='''3 1.234.65.197
6 120.38.244.29
6 183.221.184.29
6 222.129.57.61
'''
d=dict()
for g in re.finditer(r'(\d) ((?:(?:2(?:[0-4][0-9]|5[0-5])|[0-1]?[0-9]?[0-9])\.){3}(?:(?:2(?:[0-4][0-9]|5[0-5])|[0-1]?[0-9]?[0-9])))',s):
d[g.group(1)]=g.group(2)

print d
Nov 15, 2014
Replied to a topic by fortunezhang Python python 正则找到规律数据
正则表达式为 (?<=<data>)(.*?)(?=<\/data>)

import re

m=re.findall(r'(?<=<data>)(.*?)(?=<\/data>)','<Data>1=1&2=2</Data><Data>abc</Data><Data>nihao</Data>',re.I|re.M)

print m
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3534 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 04:20 · PVG 12:20 · LAX 21:20 · JFK 00:20
♥ Do have faith in what you're doing.