les(filename, file2,top)print "finished" thanks! --Senthil From: [EMAIL PROTECTED][mailto:[EMAIL PROTECTED] On Behalf Of DavidHollandSent: Sunday, February 12, 2006 3:40 AMTo: BruceCc: tutor pythonSubject: Re: [Tutor] Changefiles Bruce,Thanks but is
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of David
HollandSent: Sunday, February 12, 2006 3:40 AMTo:
BruceCc: tutor pythonSubject: Re: [Tutor] Change
files
Bruce,Thanks but is was not the solution. It goes
through all the directories but does not seem t
> for root, dirs, files in os.walk(top):
> for name in dirs:
> print name
> for name in files:
This code looks suspicious. At this point, when we say "name", what do we
expect to get here? Do you mean the directory name, or the file name?
It can't be both!
Bruce, Thanks but is was not the solution. It goes through all the directories but does not seem to work. Here is the modified code :- def getfiles(file1,file2,top): for root, dirs, files in os.walk(top): for name in dirs: print name for name in files:
I wrote a little program that replaces all files called 'abcde' with the file in the directory from which you riun the program. However it does not find them (there is another one). What have I done wrong :- #this program copies the file x to all other places in the directory. #however it does not