Solve task
This commit is contained in:
+4
-4
@@ -3,13 +3,13 @@ import zipfile
|
||||
import csv
|
||||
|
||||
res = []
|
||||
zips = os.listdir('Nintendo DS')
|
||||
zips = os.listdir("Nintendo DS")
|
||||
for z in zips:
|
||||
with zipfile.ZipFile('Nintendo DS/'+z) as myzip:
|
||||
with zipfile.ZipFile("Nintendo DS/" + z) as myzip:
|
||||
info = myzip.infolist()
|
||||
for i in info:
|
||||
res.append([z, i.filename, int(i.file_size/(1024**2))])
|
||||
res.append([z, i.filename, int(i.file_size / (1024 ** 2))])
|
||||
|
||||
with open('archive.csv', 'w', newline='') as f:
|
||||
with open("archive.csv", "w", newline="") as f:
|
||||
writer = csv.writer(f)
|
||||
writer.writerows(res)
|
||||
|
||||
Reference in New Issue
Block a user