kiri
kiri

Reputation: 2642

How to get the filepath of a ZipFile object?

If I have a zipfile.ZipFile object, how can I determine the file path of the zip file from the object?

a = zipfile.ZipFile('C:\\path\\zipfile.zip')

a.get_file_path()

where get_file_path() should return 'C:\\path\\zipfile.zip'.

Upvotes: 7

Views: 6221

Answers (1)

falsetru
falsetru

Reputation: 369164

You can access it using filename attribute:

a.filename

Upvotes: 6

Related Questions