看板 [ Python ]
討論串[問題]想把文章的註腳移到正文後面, 關於re跟 …
共 3 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者opiumeater (opiumeater)時間14年前 (2010/11/25 02:01), 編輯資訊
0
0
0
內容預覽:
sunrise0406你好,謝謝你,我終於解決這個問題了,. 下面是我試出來的結果,跟大家分享。. 怕自己以後忘記,所以記詳細一點^-^. import re. def footnote(path):. a = open(path).read(). p1 = re.compile('<a href=
(還有429個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者sunrise0406 (baker)時間14年前 (2010/11/25 00:39), 編輯資訊
0
0
0
內容預覽:
修改9~13. for pattern_repl in data:. myfile = myfile.replace(pattern_repl[0],pattern_repl[1],1). open(path,'w').write(myfile). --. 發信站: 批踢踢實業坊(ptt.cc)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者opiumeater (opiumeater)時間14年前 (2010/11/25 00:04), 編輯資訊
0
0
0
內容預覽:
p1跟p2都可以找到值,但是不能取代. 實例:. p1 = <a href="#_ftn1013" name="_ftnref1013" title=""><sup>*</sup></a>. p2 = <a href="#_ftnref1013" name="_ftn1013" title="">&
首頁
上一頁
1
下一頁
尾頁