import codecs flout = codecs.open('uni.txt','w','latin-1','replace') # flout.write(u' e') flout.close()