Created
August 19, 2017 10:42
-
-
Save tobywf/3773a7dc896f780c2216c8f8afbe62fc to your computer and use it in GitHub Desktop.
Generate a UTF-8 comma separated value (CSV) file that Excel reads reliably (Python 3, obvs)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
with open('test.csv', 'w', encoding='utf-8-sig', newline='') as fp: | |
writer = csv.writer(fp) | |
writer.writerow(['Row', 'Emoji']) | |
for i, emoji in enumerate(['π ', 'π€', 'π']): | |
writer.writerow([str(i), emoji]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That just simply doesn't work at all. This is what I got when I execute your code in AWS Python 3.12.1 Lambda.

Update: This piece of code actually works. It just doesn't work correctly when you put it in Python AWS Lambda.