Skip to content

Instantly share code, notes, and snippets.

@saml
Created September 20, 2012 17:41
Show Gist options
  • Save saml/3757292 to your computer and use it in GitHub Desktop.
Save saml/3757292 to your computer and use it in GitHub Desktop.
import os
import random
RANDOM_INTS_PATH='random-ints.txt'
LIMIT=1000000000000000
if not os.path.exists(RANDOM_INTS_PATH):
os.mkfifo(RANDOM_INTS_PATH)
with open(RANDOM_INTS_PATH, 'w') as f:
for x in xrange(LIMIT):
f.write(str(random.randrange(LIMIT)))
f.write('\n')
#while read x; do echo "$x"; done < random-ints.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment