Created
October 13, 2018 16:22
-
-
Save envil/1ccd0d9af2c251448d30c5b2a91520cc to your computer and use it in GitHub Desktop.
Generate a very large random text file
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
import random | |
import string | |
def generator(size=6, chars=string.ascii_uppercase + string.digits): | |
return ''.join(random.choice(chars) for _ in range(size)) | |
def ran(): | |
return random.randint(0, 3800) | |
fo = open("bigtext.txt", "a") | |
for x in xrange(0, 1000000): | |
fo.write('{0}\n'.format(generator(ran()))) | |
fo.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment