PDA

View Full Version : yes, that's right...


inkedmn
04-22-2002, 11:57 PM
some more code for you...


#!/usr/bin/env python

import random, sys

if len(sys.argv) > 2 or len(sys.argv) < 1:
print "Usage: python %s <number of characters>" % sys.argv[0]
sys.exit()

elif len(sys.argv) == 1:
x = int(raw_input("How many characters long do you want the password to be? "))

else:
x = int(sys.argv[1])

password = ''

while x > 0:
letter = random.choice('0987654321ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz')
password += letter
x = x - 1

print password



whipped that up a couple nights ago. i was bored.

anyway, enjoy or something...

kmj
04-23-2002, 09:25 AM
Here's a little utility I whipped up last night

I had to have 550 copies of the same file in the same directory to run some tests...


import shutil, sys

filename = sys.argv[1]
number = int(sys.argv[2])

for x in range(number):
shutil.copyfile(filename, 'pg'+str(x)+'.tif')


shutil is cool. (c: