From faaf205d0a60aa5376b0a291308289ac5f5c8bfe Mon Sep 17 00:00:00 2001 From: pierre Date: Fri, 2 Feb 2024 00:01:34 +0100 Subject: [PATCH] windows --- textwordcloud.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/textwordcloud.py b/textwordcloud.py index d8b6ada..aa669eb 100644 --- a/textwordcloud.py +++ b/textwordcloud.py @@ -95,7 +95,7 @@ class WordCloud(AnalyseText): def make_wordcloud(self) : act = ['\t'.join([act, repr(self.corpus.getlemeff(act))]) for act in self.actives] - with open(self.pathout['actives_eff.csv'], 'w') as f : + with open(self.pathout['actives_eff.csv'], 'w', encoding='utf8') as f : f.write('\n'.join(act)) @@ -115,7 +115,7 @@ class ClusterCloud(WordCloud): else: tokeep = 2 prof = [[val[0], int(round(val[tokeep]))] for val in prof] - with open(self.pathout['actives_eff.csv'], 'w') as f : + with open(self.pathout['actives_eff.csv'], 'w', encoding='utf8') as f : f.write('\n'.join(['\t'.join([val[0], repr(val[1])]) for val in prof])) dictcol = dict([[i, val] for i, val in enumerate(prof)]) self.actives = [val[0] for val in prof] -- 2.7.4