""")
theindex.writelines([l for l in open(directorypath+"README").readlines()])
theindex.write("
")
theindex.write(middleahtml)
myoutls=commands.getoutput("find "+directorypath+rec+" -type d -print").split("\n")
print "Including the following folder(s):"
for i in sorted(myoutls):
print "\t"+i
i=i.replace(" ","\ ")
theindex.write("
")
tmp=commands.getoutput("ls "+i+"/*.png "+i+"/*.gif "+i+"/*.txt " +i+"/*.[jJ][pP][gG]" ).split("\n")
tmpsize=len(tmp)
for ii in range(0,tmpsize):
if((tmp[ii].find("No such file or directory"))==-1):
theindex.write("