On Mar 22, 1:43 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hi,
> how can I do
> * for each sub-directory of  the current directory
> * tar that to a tar file
> * remove that sub-directory

Grab the directories with the glob module and read them into a list.
Use a for loop to loop over them and the tar module (tarfile) or pytar
(see below for link) to write them to a tar file. Finally, use
os.remove or the shutil module to delete the directories.

http://sourceforge.net/projects/pytar/

Mike

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to