From: Pierre Ratinaud Date: Sat, 13 Sep 2014 15:10:19 +0000 (+0200) Subject: ... X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=commitdiff_plain;h=bce57aaafdd0ddc307c04ae49f3eca4beb81806f ... --- diff --git a/tabsplitvar.py b/tabsplitvar.py new file mode 100644 index 0000000..6671d96 --- /dev/null +++ b/tabsplitvar.py @@ -0,0 +1,38 @@ +#!/bin/env python +# -*- coding: utf-8 -*- +#Author: Pierre Ratinaud +#Copyright (c) 2014 Pierre Ratinaud +#License: GNU/GPL + +import os +import wx +from chemins import ffr, FFF +import tempfile +from time import sleep +from analysematrix import AnalyseMatrix +from functions import exec_rcode, check_Rresult +from dialog import FreqDialog +from PrintRScript import PrintRScript + +class SplitMatrixFromVar(AnalyseMatrix): + def doparametres(self, dlg=None) : + if dlg is None : + return + else : + dial = FreqDialog(self.parent, -1, self.tableau.get_colnames(), u"Column", size=(350, 200)) + dial.CenterOnParent() + val = dial.ShowModal() + if val == wx.ID_OK : + self.parametres['colsel'] = dial.list_box_1.GetSelections() + self.parametres['header'] = dial.header + else : + self.parametres = None + dial.Destroy() + + def doanalyse(self): + newtabs = self.tableau.splitfromvar(self.parametres['colsel'][0]) + for mod in newtabs : + fout = self.tableau.pathout['%s.csv' % mod].replace(u'*','') + with open(fout, 'w') as f : + f.write('\n'.join(['\t'.join(line) for line in newtabs[mod]]).encode(self.parent.syscoding)) + print 'done!' \ No newline at end of file