Advertisement
Guest User

Untitled

a guest
Nov 25th, 2021
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. from io import BytesIO
  2. from sys import stdin
  3. from zipfile import ZipFile
  4.  
  5. zip_from_stdin = ZipFile(BytesIO(bytes.fromhex(stdin.read())))
  6.  
  7. root_files_size = 0
  8. root_files_amount = 0
  9.  
  10. for file in zip_from_stdin.filelist:
  11.     if file.is_dir():
  12.         root_files_size += file.file_size
  13.         root_files_amount += 1
  14.  
  15. print(root_files_amount, root_files_size)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement