I analyzed the code and found two mistakes:

1. I wrote 'startsWith', and not 'startswith'
2. I forgot to encode, I needed to use '.read().decode("utf-8")' rather
than '.read()' only.

This way I get the text correctly (http://pastebin.com/qy4SVdzK). I'm still
analyzing the code and fixing things, the program isn't 100% working yet.






2014-08-30 19:03 GMT-03:00 Danny Yoo <d...@hashcollision.org>:

> > So the loop really should be:
> >
> >         for line in fh.split("\n"):
> >               ...
>
>
> Ah, apologies.  Forgot that we're in Python 3 land.  We have to be
> consistent with the types a lot more.  This should be:
>
>          for line in fh.split(b"\n"):
>                ...
>
> Apologies.  I should have tested with a Python 3 interpreter in hand.
>
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to