uwescience / datasci_course_materials

Public repository for course materials for the Data Science at Scale Specialization at Coursera

Home Page:https://www.coursera.org/learn/datasci

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Assignment 1 for Windows

johnrevans6 opened this issue · comments

I'm putting this here for posterity. No real action required.

Issue Summary:
Windows users not using the course's image may encounter an infuriatingly frustrating issue if they out their file using the command:

python twitterstream.py > output.txt

This defaults the encoding Windows-1252 and the output looks something like:

This will inevitably cause JSON parsing to fail.

Solution:

In Powershell, pipe in Out-File and force UTF-8. So something like:

python twitterstream.py | Out-File -Encoding "UTF8" output.txt

In command prompt, you actually need to convert the default encoding temporarily:

chcp 65001

Then run the command as normal. Then convert back:

chcp 1252