Re: [Tutor] How can I copy files recursively?

2006-07-11 Thread Danny Yoo
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

Re: [Tutor] How can I copy files recursively?

2006-07-11 Thread Kent Johnson
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

Re: [Tutor] How can I copy files recursively?

2006-07-11 Thread Michael P. Reilly
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

Re: [Tutor] How can I copy files recursively?

2006-07-11 Thread Alan Gauld
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

Re: [Tutor] How can I copy files recursively?

2006-07-11 Thread Richard Querin
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

Re: [Tutor] How can I copy files recursively?

2006-07-11 Thread Alan Gauld
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

[Tutor] How can I copy files recursively?

2006-07-10 Thread Richard Querin
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

Re: [Tutor] How can I copy files recursively?

2006-07-10 Thread Dustin J. Mitchell
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

Re: [Tutor] How can I copy files recursively?

2006-07-10 Thread John Fouhy
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

Re: [Tutor] How can I copy files recursively? [Off Topic, AGAIN]

2006-07-10 Thread زياد بن عبدالعزيز الباتلي
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