Skip to content

Instantly share code, notes, and snippets.

@vssun
Created February 4, 2012 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vssun/1737703 to your computer and use it in GitHub Desktop.
Save vssun/1737703 to your computer and use it in GitHub Desktop.
ഒരു താളിന്റെ ഉപതാളുഅളുടെ പട്ടികയുണ്ടാക്കാൻ. ഈ പ്രോഗ്രാം തന്നെ ഒരു പദത്തിൽത്തുടങ്ങുന്ന താളൂകളുടെ പട്ടികയുണ്ടാക്കാനും ഉപയോഗിക്കാം.
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
ഒരു താളിന്റെ ഉപതാളുഅളുടെ പട്ടികയുണ്ടാക്കാൻ. ഈ പ്രോഗ്രാം തന്നെ ഒരു പദത്തിൽത്തുടങ്ങുന്ന താളൂകളുടെ പട്ടികയുണ്ടാക്കാനും ഉപയോഗിക്കാം.
നിർമ്മിച്ചത്: സുനിൽ വി.എസ്.
തിയതി: 2012-01-21
"""
import wikipedia
import pagegenerators
import codecs
#പ്രധാന പ്രോഗ്രാം ഇവിടെ തുടങ്ങുന്നു.
#ആവശ്യത്തിനനുസരിച്ച് മാറ്റങ്ങൾ ഇതിനു താഴെ വരുത്തുക
siteFamily = 'wikipedia'
siteLangCode = 'ml'
workingPage = ur'ഫലകം:History/' #ഏതു താളിൽ പണിചെയ്യണം? പ്രധാന താൾ കൂടി ഉൾപ്പെടുത്തണമെങ്കിൽ അവസാനമുള്ള / ഒഴിവാക്കുക
#ആവശ്യത്തിനനുസരിച്ച് മാറ്റങ്ങൾ ഇതിനു മുകളിൽ വരുത്തുക
wikiSite = wikipedia.Site(code=siteLangCode, fam=siteFamily)
myPageList = ur""
for myPage in pagegenerators.PrefixingPageGenerator(workingPage):
myPageList+=myPage.title()+'\n'
pageListFile = codecs.open('pagelist.txt', mode='w', encoding = 'utf-8')
pageListFile.write(myPageList);
pageListFile.flush()
pageListFile.close()
wikipedia.stopme()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment