Re: [Tutor] Change files

2006-02-12 Thread David Holland
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

Re: [Tutor] Change files

2006-02-12 Thread Senthil_OR
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

Re: [Tutor] Change files

2006-02-11 Thread Danny Yoo
> 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!

Re: [Tutor] Change files

2006-02-11 Thread David Holland
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:

[Tutor] Change files

2006-02-10 Thread David Holland
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