Archived
1
0
This repository has been archived on 2025-04-27. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
schools/main/secret.py

18 lines
530 B
Python
Executable File

#!/usr/bin/env python3
def get_key(filename: str):
"""
Provide a path to a valid file, this will return the contents.
Parameters:
filename (str): path to file
Returns:
schools (dict): Collated response from API
"""
try:
with open(filename, 'r') as f:
# It's assumed our file contains a single line,
# with our API key
return f.read().strip()
except FileNotFoundError:
print("'%s' file not found" % filename)