def __init__(self, filename=None, sufix='.encrypted'): key = utils.read_whole_file('aes.password', 'r').strip() self.cipher = AESCipher(key) self.base_filename = filename self.sufix = sufix if filename: self.open(filename) else: self.file = None
def main(): draws, boards = utils.read_whole_file(pre_process_data) last_draw, board = get_losing_board(draws, boards) if board is None: print("Error: No board returned") return u_sum = board.get_unmarked_sum() print("The unmarked sum is {}. The marked sum is {}. The final score is {}.".format(u_sum, last_draw, u_sum * last_draw))
def _run_program(input_path): input_nums = U.read_whole_file(input_path) game = CupsGame(debug=False) for num in input_nums: game.insert(int(num)) part1(game) game = CupsGame(debug=False) for num in input_nums: game.insert(int(num)) part2(game)
def get_data() -> np.ndarray: return utils.int_list(utils.read_whole_file(), ',')
def get_data() -> defaultdict: return utils.read_whole_file(pre_process_data)
def get_data() -> tuple: data = utils.read_whole_file().split('\n\n') template = data[0] rules = pre_process_rules(data[1]) return template, rules
def encrypt_file(self, filename): self.close() data = utils.read_whole_file(filename, 'rb') self.open(filename) self.write(data)
def get_data() -> tuple: return utils.read_whole_file(pre_process_data)