Skip to content

Instantly share code, notes, and snippets.

@blackknight36
Created February 20, 2021 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blackknight36/b9a08bc8e86f3448b7dfed2eb0148b8c to your computer and use it in GitHub Desktop.
Save blackknight36/b9a08bc8e86f3448b7dfed2eb0148b8c to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import commands
import sys
import md5
import random
if len(sys.argv) <= 2:
print("usage: mk_ipsum.py <num> <dir>\n")
sys.exit(1)
else:
fmax = int(sys.argv[1])
spooldir = sys.argv[2]
for i in range(fmax):
text = commands.getoutput("/home/wattersm/git/pypsum/pypsum.py") + "\n"
hash = md5.new()
hash.update(str(text))
name = hash.hexdigest()
fname = spooldir + "/" + name + ".txt"
f = open(fname, 'w')
f.write(text)
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment