>>> import shutil
>>> shutil.unpack_archive('linux-2.6.11.tar.gz')
>>> shutil.make_archive('linux26', 'zip', 'linux-2.6.11')
'/tmp/linux26.zip'
>>> shutil.get_archive_formats()
[('bztar', "bzip2'ed tar-file"), ('gztar', "gzip'ed tar-file"), ('tar', 'uncompressed tar file'), ('xztar', "xz'ed tar-file"), ('zip', 'ZIP file')]
>>> shutil.unpack_archive('linux-2.6.11.tar.gz')
>>> shutil.make_archive('linux26', 'zip', 'linux-2.6.11')
'/tmp/linux26.zip'
>>> shutil.get_archive_formats()
[('bztar', "bzip2'ed tar-file"), ('gztar', "gzip'ed tar-file"), ('tar', 'uncompressed tar file'), ('xztar', "xz'ed tar-file"), ('zip', 'ZIP file')]
Comments
Post a Comment
https://gengwg.blogspot.com/