import os, string def doDir(dir) : global outf outf.write("
\n") flist = os.listdir(dir) for i in flist : print i if weShouldList(i) : fn = dir + "/" + i outf.write("
") outf.write(' %s \n' %(fn,fn)) outf.write("
") outf.write("no description yet" ) if shouldWeDescend(fn) : doDir(fn) outf.write("
\n") else : pass outf.write("
\n") def weShouldList(i) : if i.endswith(".class") : return 0 if i.startswith("level") : return 0 if i.endswith("pyc") : return 0 if i.endswith(".out") : return 0 return 1 def shouldWeDescend(i) : print "should we ", i if not os.path.isdir(i) : return 0 if i.endswith("..") : return 0 if i.endswith(".") : return 0 return 1 global outf outf = open("x.html", "w") outf.write("\n") doDir(".") outf.write("\n") outf.close()