I am trying to extract the file location for JSON data within a zip file.
The file path to the zip file is being generated as a string. I am then inserting an if statement to parse the zip data.
I am using “zipfile” with the following code:
if inputfilepathname.endswith(".zip"):
print (inputfilepathname)
with zipfile.ZipFile(inputfilepathname, "r") as z:
for filename in z.namelist():
print(filename)
Where “inputfilepathname” is a string pointing to the ZIP file.