how to move files based on file-ending from dirs and subdirs to specific dir?

Marc 'BlackJack' Rintsch bj_666 at
Tue Jan 2 09:08:07 CET 2007

In <mailman.2194.1167722106.32031.python-list at>, Evan Carmi

> top = 'f:\\test\\mail'
> […]
> indexdest = []

Here you bind the name `indexdest` to an empty list but replace it in the
very next line with another list.  So this line is unnecessary.

> indexdest = ['%s\\..\\..\\%s\\%s\\%s' % (x , time.strftime('%Y%m%d%H%M%S'),
> os.path.basename(os.path.normpath(x+'\\..')), os.path.basename(x)) for x in ind
> ex]

This line is quite complicated and I don't really grasp what it's doing.
Maybe some comments, possible with examples, are needed here.  And maybe
then you'll see why it doesn't work as wanted!?  If these are the
destination paths and they should be at the same level as `top`, where is
`top` here?  Shouldn't that be a prefix of all destination paths?

	Marc 'BlackJack' Rintsch

More information about the Python-list mailing list