Created
May 22, 2015 04:14
-
-
Save offby1/0bb81920d3a15d87a601 to your computer and use it in GitHub Desktop.
batch by 100
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
| batch = [] | |
| for line in sys.stdin: | |
| if len(batch) == 100: | |
| do_something_with_batch(batch) | |
| batch = [] | |
| batch.append(line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment