directory structure. Something like:
source = '/ipodder'
dest = '/foo/bar'
for root, dirs, files in os.walk(source):
for f in files:
os.rename(os.path.join(root, f), os.path.join(dest, f))
A helper function here will be useful. We can simulate something like:
find . -name
John Fouhy wrote:
On 11/07/06, Richard Querin [EMAIL PROTECTED] wrote:
I know this is probably a dumb question:
I've got mp3 files that are downloaded (by ipodder) into individual
subfolders. I'd like to write a quick script to move (not copy) all the mp3
files in those folders into a
On 7/10/06, Richard Querin [EMAIL PROTECTED] wrote:
I know this is probably a dumb question:I've got mp3 files that are downloaded (by ipodder) into individual subfolders. I'd like to write a quick script to move (not copy) all the mp3 files in those folders into a single destination folder. I was
subfolders. I'd like to write a quick script to move (not copy) all
the mp3
files in those folders into a single destination folder. I was
thinking I
could do it easily from the linux command line (cp -r copies the
subfolders
out as well) but I can't figure out how to do it. Is there an
On 7/11/06, Alan Gauld [EMAIL PROTECTED] wrote:
Things which are easy in the shell are usually less easy in Python.In your case a simple cp -r will copy the files and an rm -rf willdelete the originals.Or you could just use mv on the top level folder.
But I don't want the sub folders to come along
Or you could just use mv on the top level folder.
But I don't want the sub folders to come along with the copy. I'd
like to
grab the mp3 files out of a set of subfolders and place them all
into a
single folder somewhere else.
Ah, sorry, I misunderstood the question.
In that case os.walk
I know this is probably a dumb question:I've got mp3 files that are downloaded (by ipodder) into individual subfolders. I'd like to write a quick script to move (not copy) all the mp3 files in those folders into a single destination folder. I was thinking I could do it easily from the linux
Richard Querin wrote:
I know this is probably a dumb question:
I've got mp3 files that are downloaded (by ipodder) into individual
subfolders. I'd like to write a quick script to move (not copy) all the
mp3 files in those folders into a single destination folder. I was
thinking I could do
On 11/07/06, Richard Querin [EMAIL PROTECTED] wrote:
I know this is probably a dumb question:
I've got mp3 files that are downloaded (by ipodder) into individual
subfolders. I'd like to write a quick script to move (not copy) all the mp3
files in those folders into a single destination
This is “Off Topic” regarding the mailing list!
On Mon, 2006-07-10 at 22:57 -0500, Dustin J. Mitchell wrote: (altered by
Ziyad)
Richard Querin wrote:
...
I was thinking I could do it easily from the linux command line
(cp -r copies the subfolders out as well) but I can't figure out
how
10 matches
Mail list logo