import os

pwd = os.getcwd()
#com1 = "tree -H "+ '.' +" -L 1 --noreport --charset utf-8 | sed -e '/<hr>/,+7d' > "+ "./index.html"
#os.system(com1)

for f in os.listdir(pwd):
	d = os.path.join(pwd,f)
	if os.path.isdir(d):
		print(f)
		com2 = "cd " + "./" + f
		os.system(com2)
		com3 = "tree -H " + "." + " -L 1 --noreport --charset utf-8 | sed -e '/<hr>/,+7d' > " + "./index.html"
		print(com3)
		os.system(com3)
		os.system("cd ..")
