All pastes #296266 Raw Edit

Stuff

public python v1 · immutable
#296266 ·published 2006-12-30 01:38 UTC
rendered paste body
#!/usr/bin/env pythonimport globimport osimport shutilL = range(1, 100)for i in glob.glob('*.html'):        if len([x for x in i if x.isdigit()]) == 0:             #if it contains a number                dir = i[:-5]                                    #remove the '.html'                if dir not in glob.glob('*'):                        os.mkdir(dir)                           #create the directory which is named i up to .html                shutil.copy(i, dir)                             #copy the files to the directory                for y in glob.glob('./*-[1-100].html'):         #remove all files that contain numbers                        os.remove(y)                        file = open('howtofixoutput.txt', 'w')  #open file to output the redirect files                        file.write(i + '\n')                        file.close()file2 = open('howtofixoutput.txt', 'r')                         #reopen file to output the redirect filenamesprint file2.readlines()                                         #print the redirect filenames