Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- import sys, pprint, re
- sys.path.append('C:\pywikipedia')
- import wikipedia, pagegenerators
- def main(pag):
- #site = wikipedia.getSite()
- #pag = wikipedia.Page(site, pag)
- text = pag.get().splitlines()
- count = 0
- for i in text:
- if i.startswith('|'):
- text[count] = re.sub(r'[|] ?(.*?) *?= ?(.*?)', r'|\1 = \2', i)
- count += 1
- pag.put('\n'.join(text), comment=u'Bot: Reemplaçament automàtic d\'espais (+/-)')
- if __name__ == '__main__':
- gen = pagegenerators.AllpagesPageGenerator(start='El Masnou', namespace=0, includeredirects=False)
- for i in gen:
- main(i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement