Created
November 23, 2012 21:28
-
-
Save davesque/4137387 to your computer and use it in GitHub Desktop.
Shuffle the lines of a file
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
#!/usr/bin/env python | |
import sys | |
import random | |
if __name__ == '__main__': | |
contents = sys.stdin.readlines() | |
random.shuffle(contents) | |
sys.stdout.write(''.join(contents)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment