ptyhon實(shí)現(xiàn)sitemap生成示例
# _*_ coding:utf-8 _*_
#xiaohei.python.seo.call.me:)
#win+python2.7.x
id_ = 1
f = open('clubpop%s.xml' % id_, 'w')
for i, line in enumerate(open('suk.csv')):
if i % 50000==0:
print i
f.write('<?xml version="1.0" encoding="UTF-8"?>\n<urlset>\n')
f.write(''' <url>
<loc>http://www.dhdzp.com/review/%s-1-1.html</loc>
</url>
''' % line.rstrip())
if i % 50000==49999:
f.write('</urlset>')
f.close()
id_ += 1
f = open('clubpop%s.xml' % id_, 'w')
f.write('</urlset>')
f.close()
相關(guān)文章
基于python計(jì)算滾動(dòng)方差(標(biāo)準(zhǔn)差)talib和pd.rolling函數(shù)差異詳解
這篇文章主要介紹了基于python計(jì)算滾動(dòng)方差(標(biāo)準(zhǔn)差)talib和pd.rolling函數(shù)差異詳解,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2020-06-06
執(zhí)行Python程序時(shí)模塊報(bào)錯(cuò)問(wèn)題
這篇文章主要介紹了執(zhí)行Python程序時(shí)模塊報(bào)錯(cuò)問(wèn)題及解決方法,本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-03-03
python?數(shù)據(jù)挖掘算法的過(guò)程詳解
python實(shí)現(xiàn)差分隱私Laplace機(jī)制詳解
django 實(shí)現(xiàn)后臺(tái)從富文本提取純文本

