Multiple os.system calls

Alex Martelli aleax at
Fri Jan 4 08:05:24 EST 2002

"Rob Hancock" <mlistbox at> wrote in message
news:mailman.1010099405.19889.python-list at
> Hello Everyone,
> I am trying to send a list of filenames to tar.  Right
> now I'm doing this with multiple calls to os.system,
> changing the filename each time.  Horrible I know, but
> I haven't figured out how to use the other os fuctions
> to accomplish this any better.  Can someone enlighten
> me?

What about os.system('tar cf result.tar ' + ' '.join(thefilenames))?
Assuming that what tar is doing with the filenames is adding
them to a tarfile, of course (you don't really make that very
clear, at least not to my reading).


More information about the Python-list mailing list