Created
February 20, 2021 14:02
-
-
Save blackknight36/b9a08bc8e86f3448b7dfed2eb0148b8c to your computer and use it in GitHub Desktop.
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/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