Last active
February 25, 2017 11:26
-
-
Save guestl/9efa5c6e60404fb73b1e7b86e785f084 to your computer and use it in GitHub Desktop.
Load file in binary mode with lambda function
This file contains hidden or 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
| with codecs.open(filename, "rb", "utf-8") as file: | |
| for ch in iter(lambda: file.read(1), ""): | |
| print(ch) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment