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.
blockrid
 
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.
New Users, Read This
Join the #python-forum IRC channel on irc.freenode.net!
Spam topic disapproval technician
Windows7, Python 2.7.4., WxPython 2.9.5.0., some Python 3.3
User avatar
Yoriz
 
Posts: 782
Joined: Fri Feb 08, 2013 1:35 am
Location: UK


Return to General Coding Help

Who is online

Users browsing this forum: stranac and 3 guests