2018-02-13 12:10 GMT+01:00 Giuseppe Costanzi <giuseppecosta...@gmail.com>:
> > > questo uno script per simulare il problema. > > > import csv > > > class Tester(object): > def __init__(self,*args, **kwargs): > super(Tester, self).__init__( ) > > self.args = args > self.kwargs = kwargs > > def exporter(self, rs, cols): > > obj = open("out.csv",'w') > print(rs) > with obj: > writer = csv.writer(obj,delimiter=',') > writer.writerow(cols) > writer.writerows(rs) > > def main(): > > cols = ["a","b","c","d"] > > rs = [(1, 0.382, 8.59, 76.4), > (2, 0.687, 625.0, 103),] > > foo = Tester() > foo.exporter(rs, cols) > > input('end') > > if __name__ == "__main__": > main() > > A me questo codice segala che csv non ha un metodo writer, tanto con 2.7 che con 3.6.3 Carlos EZLN ... Para Todos Todo ... Nada para nosotros
_______________________________________________ Python mailing list Python@lists.python.it https://lists.python.it/mailman/listinfo/python