#!/usr/bin/env python3importsqlite3importcsvconn=sqlite3.connect('Langenscheidt e-Großwörterbuch Deutsch als Fremdsprache.sqlite3')c=conn.cursor()withopen('favlist.txt')asinf:words=inf.read().split('\n')words[0]=words[0].replace('\ufeff','')print('If error occurs, check if the broken entry can be found in dictionary.')withopen('favlist.csv','w')asoutf:listwriter=csv.writer(outf)forwdinwords:print('Adding: '+wd)c.execute('SELECT m FROM word WHERE w=?',(wd,))result=c.fetchone()listwriter.writerow([wd,result[0]])conn.close()print('Done')