[Tutor] Short Version, New guy looking for some tips, Revisited.
rmkrauter at yahoo.com
Sat Feb 7 16:56:11 EST 2004
On Sat, 2004-02-07 at 16:26, Joshua Banks wrote:
> Am I asking for a simple example. Nothing more than that.
Why don't you just take a stab at it? It doesn't have to be perfect. You
should see how many dumb ideas I've posted in attempt to just take a
stab at trying to solve something. Big deal. That's the whole point of
the mailing list.
Here's a quick example. It's bad and inflexible and very limited and
likely to die very badly in many common situations, but maybe it'll get
# requires python 2.3
if __name__ == '__main__':
fname = 'test.tar'
ext = '.gz'
archive = '%s%s'%(fname,ext)
print 'gunzip-ing %s'%archive
tar = tarfile.open(fname,'a')
for f in sys.argv[1:]:
print 'adding %s to %s ...'%(f,fname)
print 'gzip-ing %s'%fname
More information about the Tutor