V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  irosyking  ›  全部回复第 1 页 / 共 1 页
回复总数  9
2023 年 1 月 2 日
回复了 wellwellwell 创建的主题 程序员 你有哪些能让自己开心电影或剧集推荐?
中产家庭 /左右不逢源
2020 年 7 月 20 日
回复了 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
2017 年 9 月 29 日
回复了 lzjun 创建的主题 推广 赠书啦《 Python 网络数据采集》
89
2015 年 3 月 29 日
回复了 pi1ot 创建的主题 Python 有喜欢 Python 的没
好隐秘的招聘方式
2014 年 11 月 17 日
回复了 dbas 创建的主题 Python python 字符串转字典问题
2014 年 11 月 17 日
回复了 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
2014 年 11 月 15 日
回复了 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
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   5657 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 28ms · UTC 06:07 · PVG 14:07 · LAX 22:07 · JFK 01:07
♥ Do have faith in what you're doing.