会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
首页
新随笔
订阅
管理
2015年2月3日
Python根据内嵌的数字将字符串排序(sort by numbers embedded in strings)
摘要: import re re_digits = re.compile(r'(\d+)') def embedded_numbers(s): pieces = re_digits.split(s) # 切成数字与非数字 pieces[1::2] = map(int, pieces[1::2]) # 将...
阅读全文
posted @ 2015-02-03 09:17 emanlee
阅读(3530)
评论(0)
推荐(0)