This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from PIL import Image | |
import os | |
dir = 'path/to/images' | |
for file in os.listdir(dir): | |
"""to ignore .DS_STORE file""" | |
if not file.startswith("."): | |
with Image.open(dir+"/"+file) as img: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
class SecretManager: | |
def __init__(self): | |
self.secrets = {} | |
def get_secrets(self, service_name): | |
if service_name in self.secrets: | |
return self.secrets[service_name] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
# python function to check size of directory in bytes | |
def get_directory_size(directory): | |
total = 0 | |
try: | |
# check files in directory | |
for entry in os.scandir(directory): | |
if entry.is_file(): |