@@ -0,0 +1,1477 @@
+class Session:%0A%0A    def __init__(self):%0A        self.name = str(datetime.datetime.now()) + %22 %22 + options%5B%22name_method%22%5D%0A        self.files = %7B%7D%0A%0A    def acumulate(keys, values):%0A        for key in keys:%0A            pass%0A%0A    def append_vals_to_csv(self, name_file, vals):%0A        keys = sorted(list(vals.keys()))%0A        name_file_full = %22sessions/%22 + self.name + %22/%22 + name_file%0A        if name_file_full not in self.files:%0A            if not os.path.exists(os.path.dirname(name_file_full)):%0A                os.makedirs(os.path.dirname(name_file_full))%0A            if not os.path.exists(name_file_full):%0A                fd = open(name_file_full, 'w')%0A                self.files%5Bname_file_full%5D = fd%0A                writer_csv = csv.writer(%0A                    fd, delimiter=',', quotechar='%22', quoting=csv.QUOTE_MINIMAL)%0A                writer_csv.writerow(keys)%0A        # else:%0A        writer_csv = csv.writer(%0A            self.files%5Bname_file_full%5D,%0A            delimiter=',',%0A            quotechar='%22',%0A            quoting=csv.QUOTE_MINIMAL)%0A        vs = %5Bvals%5Bkey%5D for key in keys%5D%0A        writer_csv.writerow(vs)%0A        #str_row=','.join(map(str, vs))%0A        # self.files%5Bname_file%5D.write(str_row+%22%5Cn%22)%0A        # fd.close()%0A%0A    def __del__(self):%0A        for key in self.files:%0A            self.files%5Bkey%5D.close()%0A%0A    def flush(self):%0A        for key in self.files:%0A            self.files%5Bkey%5D.close()%0A            self.files%5Bkey%5D = open(key, 'a')%0A# session=Session()%0A

add session module