On Tue, 16 Dec 2008 18:20:52 -0000, ianaré <ian...@gmail.com> wrote:

Hello all,

I trying to recursively rename folders and files, and am looking for
some ideas on the best way of doing this. The problem is that the
given list of items can be in order, and one to all items may be
renamed. Here is some preliminary code I have, but which does not work
very well.

self.toRename has the following structure :
[
[original_name, new_name, os.path.isdir]
..
]

[snip]

import os

for item in self.toRename:
    os.renames(item[0], item[1])

That's it.  os.renames will take care of all the intermediate
directory creation so you don't even need to sort the list.

--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to