예제 #1
0
파일: file_encryptor.py 프로젝트: stryku/hb
 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
예제 #2
0
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))
예제 #3
0
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)
예제 #4
0
def get_data() -> np.ndarray:
    return utils.int_list(utils.read_whole_file(), ',')
예제 #5
0
def get_data() -> defaultdict:
    return utils.read_whole_file(pre_process_data)
예제 #6
0
def get_data() -> tuple:
    data = utils.read_whole_file().split('\n\n')
    template = data[0]
    rules = pre_process_rules(data[1])
    return template, rules
예제 #7
0
파일: file_encryptor.py 프로젝트: stryku/hb
 def encrypt_file(self, filename):
     self.close()
     data = utils.read_whole_file(filename, 'rb')
     self.open(filename)
     self.write(data)
예제 #8
0
def get_data() -> tuple:
    return utils.read_whole_file(pre_process_data)