On 03/11/16 17:56, Bill Nolf wrote:
> Test 4
>
> archive = tarfile.open("test.tgz", "a:gz")
> archive.add=(dirarchive, arcname="test")
> archive.close()
>
> Create a gzip file called test.tgz in the current directory, which is close
> but no cigar
> What I would like is the following gzip file:
Bill Nolf 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 mea
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
Test 1
tar.add(dirarchive)
Error: name 'tar' not defined
Test 2
tarfile.add(dirarch