Re: copying files through Python

2008-02-16 Thread Tim Chase
> OP stated requirements were to move all the files into a single > folder. Copytree will preserve the directory structure from the source > side of the copy operation. well, it would be "copying [not moving] files through Python", but if the desire is to flatten the tree into a single directory,

Re: copying files through Python

2008-02-16 Thread [EMAIL PROTECTED]
On Feb 16, 6:21 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > Please use a mailer/news-agent that preserves whitespace on the > beginning of the line, and make sure you don't use tabs but spaces to > indent. > > Apart from that - why don't you use shutil.copytree? Regarding the error > - ar

Re: copying files through Python

2008-02-16 Thread Diez B. Roggisch
Lalit Krishna schrieb: > Hi this is the code which I wrote till now. It is giving permission > denied error for sub folders of source directory. Does anyone have any > idea what is going wrong > > import os > import shutil > def copytreetosinglefolder(src, dst): > names = os.listdir(src) > if (o

Re: copying files through Python

2008-02-16 Thread Lalit Krishna
Hi this is the code which I wrote till now. It is giving permission denied error for sub folders of source directory. Does anyone have any idea what is going wrong import os import shutil def copytreetosinglefolder(src, dst): names = os.listdir(src) if (os.path.isdir(dst)==False): os.mkdir(dst)

Re: copying files through Python

2008-02-15 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > On Feb 13, 10:50 pm, Lalit <[EMAIL PROTECTED]> wrote: > >> I need to write a program which would transfer files under one folder >> structure (there are sub folders) to single folder. > > > > find /fromdir -exec mv {} /todir \; -print > > -type f -- http://mail.py

Re: copying files through Python

2008-02-15 Thread James Matthews
Basically copying a file is reading a character or string from one file and writing it to the other. On Fri, Feb 15, 2008 at 3:06 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Feb 13, 10:50 pm, Lalit <[EMAIL PROTECTED]> wrote: > > > I need to write a program which would transfer files und

Re: copying files through Python

2008-02-15 Thread [EMAIL PROTECTED]
On Feb 13, 10:50 pm, Lalit <[EMAIL PROTECTED]> wrote: > I need to write a program which would transfer files under one folder > structure (there are sub folders) to single folder. find /fromdir -exec mv {} /todir \; -print Pete -- http://mail.python.org/mailman/listinfo/python-list

Re: copying files through Python

2008-02-13 Thread Larry Bates
Lalit wrote: > I am new to python. Infact started yesterday and feeling out of place. > I need to write a program which would transfer files under one folder > structure (there are sub folders) to single folder. Can anyone give me > some idea like which library files or commands would be suitable f

Re: copying files through Python

2008-02-13 Thread Tim Chase
> I am new to python. Infact started yesterday and feeling out of place. > I need to write a program which would transfer files under one folder > structure (there are sub folders) to single folder. Can anyone give me > some idea like which library files or commands would be suitable for > this fil

copying files through Python

2008-02-13 Thread Lalit
I am new to python. Infact started yesterday and feeling out of place. I need to write a program which would transfer files under one folder structure (there are sub folders) to single folder. Can anyone give me some idea like which library files or commands would be suitable for this file transfer