ഉപയോക്താവ്:Junaidpv/translator.py

വിക്കിനിഘണ്ടു സംരംഭത്തിൽ നിന്ന്
import codecs
import wikipedia

site=wikipedia.getSite('ml','wiktionary')
wpage = wikipedia.Page(site,'User:Junaidpv/translation_table')
text  = wpage.get(get_redirect=True)
ttable = eval(text)
#print repr(ttable)
ifileName=raw_input("Enter: input file name: ")
infile = codecs.open(ifileName, encoding='utf-8')
text = infile.read()
for e, m in ttable.iteritems():
    text=text.replace(e,m)
ofileName = raw_input("Enter: output file name (if file exists, will be replaced: ")
ofile = codecs.open(ofileName,mode='w+', encoding='utf-8')
ofile.write(text)
ofile.flush()
ofile.close()
"https://ml.wiktionary.org/w/index.php?title=ഉപയോക്താവ്:Junaidpv/translator.py&oldid=45863" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്