Advertisement
Guest User

setSitelink with dictionary

a guest
Aug 7th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. import pywikibot
  3. #Using dictionary
  4. site = pywikibot.Site("test", "wikidata")
  5. repo = site.data_repository()
  6. item = pywikibot.ItemPage(repo, "Q210194")
  7.  
  8. sitedict = {'site':'enwiki', 'title':'Douglas Adams'}
  9.  
  10. item.setSitelink(sitedict, summary=u'Setting sitelink.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement