随笔 - 314  文章 - 1 评论 - 127 阅读 - 135万
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

09 2011 档案
Python使用正则表达式替换源码前序号
摘要:从博客园或其它地方拷贝代码,经常前面有代码序号,像下面这个样子:1 wbContent.Navigate(vURL);2 3 Result:=GetHtml(wbContent);4 5 while not ContainsText(Result,'共找到') do6 begin7 Sleep(100);8 Application.ProcessMessages;9 Result:=GetHtml(wbContent);10 end;11 12 Result:=GetHtml(wbContent);可以使用Python的正则表达式来简单地去掉前面的序号:importre,sys 阅读全文
posted @ 2011-09-28 16:32 garfieldtom 阅读(1029) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示