I basically want to map out folders and subfolders in a dictionary and i have this code ive written, but instead of adding each filename to the dictionary it overwrites it each time.
Any suggestions?
for fname in os.listdir(os.getcwd()):
print fname
x += 1
maincat = {fname}
print "x = " + str(x)
print maincat
print len(maincat)