On 08/14/2017 09:18 AM, banda gunda wrote:
> Dear Tutor,
>
>
> I have made some progress!
>
> But not yet got the results.
>
> Attached is revised code.
>
>
> Specifically, the problem in below:
>
>
> for root, dirs, files in os.walk(".", topdown=False):
> for name in files:
>
banda gunda wrote:
> Dear Tutor,
>
>
> I have made some progress!
>
> But not yet got the results.
>
> Attached is revised code.
>
>
> Specifically, the problem in below:
>
>
> for root, dirs, files in os.walk(".", topdown=False):
> for name in files:
>
Dear Tutor,
I have made some progress!
But not yet got the results.
Attached is revised code.
Specifically, the problem in below:
for root, dirs, files in os.walk(".", topdown=False):
for name in files:
print(os.path.join(root, name))
os.rename(path + name, path +
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
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: