import os BASE_PATH = os.path.dirname(os.path.dirname(__file__)) INPUTS_PATH = os.path.join(BASE_PATH, 'inputs') def getInputLineAsArray(day, return_type=None): """ get input for day x as array, each line representing one array entry when type is given, each entry will be converted to the specified type """ with open(os.path.join(INPUTS_PATH, str(day)), "r") as f: input_array = f.readlines() if return_type: return [return_type(i) for i in input_array] else: return input_array