From: pierre Date: Mon, 12 Feb 2024 15:26:08 +0000 (+0100) Subject: ... X-Git-Url: http://www.iramuteq.org/git?p=iramuteq;a=commitdiff_plain;h=fd7efd8a5b2427f10594d3e325d99bbddadff3d3 ... --- diff --git a/tabchi2.py b/tabchi2.py index 8d6f208..aa5ea7c 100755 --- a/tabchi2.py +++ b/tabchi2.py @@ -308,7 +308,7 @@ class ChiSquare(AnalyseMatrix): """ % (ffr(self.parametres['pathout']),ffr(self.OutFrame)) tmpfile=tempfile.mktemp(dir=self.TEMPDIR) print(tmpfile) - tmpscript=open(tmpfile,'w') + tmpscript=open(tmpfile,'w', encoding='utf8') tmpscript.write(txt) tmpscript.close() pid = exec_rcode(self.RPath, tmpfile, wait = False) @@ -334,7 +334,7 @@ class ChiSquare(AnalyseMatrix): def dolayout(self, option): ListFile=[False] - file=open(self.OutFrame,'r') + file=open(self.OutFrame,'r', encoding='utf8') content=file.readlines() file.close() lcont = [line.replace('"','').replace('\n','').split(';') for line in content] @@ -381,7 +381,7 @@ class ChiSquare(AnalyseMatrix): allhtml.append(html_graphs) header=""" \n - \n + \n \n

Test du Chi2

\n
@@ -391,12 +391,12 @@ class ChiSquare(AnalyseMatrix): p <= 0.05 mais il y a des valeurs théoriques < 5
p > 0.05

- """%self.parent.SysEncoding + """ pretxt = '
\n'.join(links)+'


\n' txt = '


\n'.join(['

'.join([tab[i] for tab in allhtml]) for i,val in enumerate(res)]) txt = header + pretxt + txt + '\n' fileout=os.path.join(self.parametres['pathout'],'resultats-chi2.html') - with open(fileout, 'w') as f : + with open(fileout, 'w',encoding='utf8') as f : f.write(txt) ListFile.append(fileout) return ListFile