From ca118432103465f7e91dc6d09f828088ba5b0f90 Mon Sep 17 00:00:00 2001 From: Aayush Kumar Singha Date: Fri, 8 Jan 2016 15:36:03 +0530 Subject: [PATCH] Adding another implementation way without BytesIO --- README | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README b/README index aef659b..2311af3 100644 --- a/README +++ b/README @@ -16,3 +16,13 @@ You can work around it by encoding everything just before calling write (or just >>> row = r.next() >>> print row[0], row[1] é ñ + +#Another way to implement without BytesIO +#Assume any_list_1 and any_list_2 contains special characters in UTF-8 +import unicodecsv as csv + +with open(filename,"w") as f: + opWriter = csv.writer(f) + for i in range(0,10): + opWriter.writerow( [ any_list_1[i], any_list_2[i] ] ) +