I would like to open up a bunch of files within a folder within a folder and
then process them and output them in another location but with the same
folder structure. I seem to having trouble with the folder within folder
section.
I have a separate folder for each year and then within a year I have a
separate folder for each month but when I try to make a directory in a new
location it does not place the month folders within the year folders,
instead they are all places in the outputpath together
any help will be greatly appreciated

import os

inputpath=r'E:/temp_samples2/'
outputpath=r'E:/figureoutputs/'

for (path, dirs, files) in os.walk(inputpath):
    for dir in dirs:
        print path, dir
        newfolders=outputpath+dir
        if not os.path.exists(newfolders):
               os.makedirs(newfolders)
           print newfolders
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to