1

i need to create a lzma file with the existing .tar file and another metadata file to further create a zip file.

2 Answers 2

1

first download/install PyLZMA. In your program, use it as described here. And to create a zip, you can use the zipFile-module of the standard-library, which works as follows:

# open the zip file for writing, and write stuff to it file = zipfile.ZipFile("test.zip", "w") for name in a_demo_list_of_files: file.write(name, os.path.basename(name), zipfile.ZIP_DEFLATED) file.close() 

Hope it helps!

Sign up to request clarification or add additional context in comments.

1 Comment

zipfile.ZIP_DEFLATED uses zlib. Use zipfile.ZIP_LZMA to use lzma. docs.python.org/3/library/zipfile.html
-1

if you can use python 3.3 and later, you could use the built-in lzma module

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.