Skip to content

Instantly share code, notes, and snippets.

@796F
Created February 24, 2014 05:41
Show Gist options
  • Save 796F/9182540 to your computer and use it in GitHub Desktop.
Save 796F/9182540 to your computer and use it in GitHub Desktop.
broken file creator - for turning in those assignments that you have yet to finish ...
import sys
import os
import random
if __name__ == '__main__':
if len(sys.argv) != 3:
print "USAGE: python bad_file.py <FILE_NAME> <FILE_SIZE_KB>"
quit()
size = sys.argv[2]
name = sys.argv[1]
print 'Creating a %s KB file named %s ...' % (size,name)
with open(name, 'wb') as fout:
fout.write(os.urandom(int(size) * 1024))
@796F
Copy link
Author

796F commented Feb 24, 2014

made this for a friend who often procrastinated.

it did not help with the procrastination.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment