def __init__(self, f, dialect=csv.excel, encoding="utf-8", **kwargs):
"""
Instantiates the UnicodeWriter instance
:param f: File like object to write CSV data to
:param dialect: The dialect for the CSV
:param encoding: The CSV encoding
:param kwargs: Keyword args
"""
self.queue = cStringIO.StringIO()
self.writer = csv.writer(self.queue, dialect=dialect, **kwargs)
self.stream = f
self.encoder = codecs.getincrementalencoder(encoding)()
评论列表
文章目录