Names from files in 7z compression?

This is the place for queries that don't fit in any of the other categories.

Names from files in 7z compression?

Postby blockrid » Tue Jun 10, 2014 5:00 pm

Hello, I am a new python programmer, I am trying to learn as I will be using it at work.

My question is essentially, if I wanted to retrieve the names of files in a compressed 7z directory, how would I go about this? I'm using Python 3.4, and so far my attempts at using the lzma library and the zipfile library have both failed. I believe I was at one point able to read() it into a variable or something step by step using the command line, but am a little lost after that.

I also want to do this without extracting the 7z itself, as I just want to add the names of the contained files to an object I'm creating.

Any help would greatly be appreciated, and I'm sorry if I'm missing any forum etiquette, I've never really posted to anything like this before.

Thank you.
Last edited by Yoriz on Tue Jun 10, 2014 5:13 pm, edited 1 time in total.
Reason: First post lock.
Posts: 1
Joined: Tue Jun 10, 2014 4:51 pm

Re: Names from files in 7z compression?

Postby Yoriz » Tue Jun 10, 2014 5:13 pm

Welcome to the forum.
Please read the new user read this link in my signature.
Due to the reasons discussed here we will be moving to on October 1 2016
This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.
User avatar
Posts: 1672
Joined: Fri Feb 08, 2013 1:35 am
Location: UK

Return to General Coding Help

Who is online

Users browsing this forum: Bing [Bot] and 10 guests