recursive file editing
TaeKyon
mikalzetTogli at interfree.it
Tue Apr 6 07:58:00 EDT 2004
Il Sun, 04 Apr 2004 12:11:25 +0200, Peter Otten ha scritto:
> The following code comes with no warranties. Be sure to backup valuable data
> before trying it. You may need to edit the regular expressions. Call the
> script with the directory you want to process.
Seems to work all right !
I have a question:
> class Path(object):
# multiple function definitions follow, amongst which:
> def files(rootfolder):
> for folder, folders, files in os.walk(rootfolder):
> for name in files:
> yield Path(folder, name)
So 'Path' is the name of a class and _contemporaneously_ the
result of one of the functions the class contains ?
Or are there really two separate 'Path' things which don't interfere
because each has its own namepace ?
I'm sorry for the repeated questions, maybe I should take this discussion
over to the tutor mailing list !
--
Michele Alzetta
More information about the Python-list
mailing list