[Tutor] conditional renaming folder and files in the tree

2017-08-12 Thread banda gunda
Dear Tutor, I want to change the name of the folders and the files in the tree. All those folders and files starting with name string '---'. Examples: If a folder name is : \---DAT1 I want to change this to: \changedDAT1 If a file name is: \---1.txt I want to change this to: \changed1.txt

Re: [Tutor] conditional renaming folder and files in the tree

2017-08-12 Thread Alan Gauld via Tutor
On 11/08/17 16:10, banda gunda wrote: > for root, dirs, files in os.walk(".", topdown=False): > for name in files: > print(os.path.join(root, name)) > os.rename(name.replace("---", "changed")) Here you give the new name but not the original name. The function needs two values,

Re: [Tutor] Percentage of installations without setuptools (Was if __name__=='__main__' ...)

2017-08-12 Thread Steven D'Aprano
On Fri, Aug 11, 2017 at 02:35:00PM +0200, Thomas Güttler wrote: > How high is the percentage of python installation which don't have > setuptools? > > I have no clue. Is it 5%, 10%, 15% ...? > > I know there is no definite answer to this question. But you can guess this > better than me. Some

[Tutor] Long post: Request comments on starting code and test code on chess rating project.

2017-08-12 Thread boB Stepp
I mentioned in one of the recent threads that I started that it is probably time for me to attempt a substantial project using the OO paradigm. I have had no coursework or training in OOP other than my recent self-studies. Everything (Other than toy practice examples.) I have coded to date has be

Re: [Tutor] Long post: Request comments on starting code and test code on chess rating project.

2017-08-12 Thread Steven D'Aprano
I haven't had a chance to read the entire post in detail, but one thing which stands out: On Sun, Aug 13, 2017 at 12:22:52AM -0500, boB Stepp wrote: > I have started my coding with a RatingCalculator class. The intent of > this class is to gather all methods together needed to validate and > ca