#-*- coding: utf-8 -*- #fetching the needed library modules import csv, time, pywikibot WAIT_TIME = 7 with open('123.csv', 'r') as csvfile: reader = csv.reader(csvfile,delimiter="~") for row in reader: wiktHeader = row[0]#.decode('utf-8') commonsFile = row[1]#.decode('utf-8') commonsFileWikt = '{{படம்|'+commonsFile+'|en|}}'#.decode('utf-8') # print (commonsFile) # print (commonsFileWikt) site1 = pywikibot.Site('ta', 'wiktionary') page = pywikibot.Page(site1, wiktHeader) page.text = commonsFileWikt+'\n'+page.text catSummary = ''' + [[பகுப்பு:ஆங்கிலம்-படங்களுள்ளவை|பகுப்பு]]''' + commonsFile #.decode('utf-8') print (page.text) page.save(summary = catSummary) time.sleep(WAIT_TIME)