看板 Python 關於我們 聯絡資訊
各位大大好 假設我有三行字 EX: 2011 09 09 2011 09 10 2011 09 11 (都是以空白做分隔) 請問用python可以變成url嗎(下面那樣)??? EX: xxx.xxx.com/2011/09/09 xxx.xxx.com/2011/09/10 xxx.xxx.com/2011/09/11 感謝各位 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.33.86.65
Conjuror:用 regular expression 的 replace 替換掉就好了 09/11 01:05
yoco315:'xxx.xxx.com/%s/%s/%s' % tuple('2011 09 09'.split()) 09/11 01:30
angusj:'xxx.xxx.com/'+'/'.join('2011 09 09'.split()) 09/11 03:16
Andy58974:非常抱歉我沒有講清楚... 09/12 02:35
Andy58974:我是想問...變成url之後可以放在網頁上面直接開嗎??? 09/12 02:37
Andy58974:import urllib 09/12 02:37
Andy58974:urllib.urlopen()用這個 09/12 02:38
Andy58974:或是有沒有辦法直接把那url放在網頁上開啟??? 09/12 02:43
Andy58974:感謝各位 09/12 02:44