[Tutor] tar a directory

2016-11-03 Thread Bill Nolf
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

[Tutor] compress directory

2016-11-03 Thread Bill Nolf
How do I compress (gzip and/or tar) a directory in python? I found examples of compressing a file using gzip or tar but not a directory. thanks ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.o