This file contains 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
from contextlib import contextmanager | |
@contextmanager | |
def handle_division_error(): | |
try: | |
yield | |
except ZeroDivisionError as zde: | |
print('zero division error') | |
This file contains 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 json | |
with open('/etc/app_config/config.json', 'r') as config_file: | |
cfg = config_file.read() | |
configs = json.loads(cfg) | |
print(configs['GITHUB_URL']) | |