[Tutor] tar a directory

Ben Finney ben+python at benfinney.id.au
Thu Nov 3 23:16:59 EDT 2016


Bill Nolf <bn58243 at gmail.com> writes:

> python version 2.6.6
>
> I'm trying to tar/gzip a directory, the directory is defined as an variable
>
> I want to tar and gzip the directory archive in the example below:
>
> import tarfile
> dirarchive = /a/b/c/archive

This code will not run.

I can guess what you might mean, but the larger problem is: You are
obviously running different code from what you present here to us.

Can you instead make a complete, simple example that *you* have run, and
you know the result? That way, we will all be looking at the same code
and the same behaviour.

-- 
 \       “Try to learn something about everything and everything about |
  `\                                  something.” —Thomas Henry Huxley |
_o__)                                                                  |
Ben Finney



More information about the Tutor mailing list