Re: [Tutor] Change files

2006-02-12 Thread Senthil_OR
ile1 = filenamefile2 = a+ os.sep +filenameprint file2getfiles(filename, file2,top)print "finished" thanks! --Senthil From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David HollandSent: Sunday, February 12, 2006 3:40 AMTo: BruceCc: tutor pythonSubjec

Re: [Tutor] Change files

2006-02-12 Thread David Holland
HollandSent: Sunday, February 12, 2006 3:40 AMTo: BruceCc: tutor pythonSubject: Re: [Tutor] Changefiles Bruce,Thanks but is was not the solution. It goesthrough all the directories but does not seem to work.Here is the modifiedcode :-def getfiles(file1,file2,top): for

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: if name == file1: name =

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!

[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