Mercurial > public > bitcaviar-plus
comparison README.md @ 20:b3eb78c5d03b
update documentation
author | Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com> |
---|---|
date | Wed, 10 Nov 2021 11:45:46 +0100 |
parents | 905b6fdc5e1b |
children | 2a4ee2f23e0c |
comparison
equal
deleted
inserted
replaced
19:905b6fdc5e1b | 20:b3eb78c5d03b |
---|---|
37 file_counter += 1 | 37 file_counter += 1 |
38 file_name = 'path/to/file/blk{}.dat'.format(str(file_counter).zfill(5)) | 38 file_name = 'path/to/file/blk{}.dat'.format(str(file_counter).zfill(5)) |
39 with open(file_name, 'rb') as f: | 39 with open(file_name, 'rb') as f: |
40 file_size = os.path.getsize(file_name) | 40 file_size = os.path.getsize(file_name) |
41 while f.tell() < file_size: | 41 while f.tell() < file_size: |
42 block = deserialize_block(f) | 42 try: |
43 block = deserialize_block(f) | |
44 except InvalidMagicBytes as e: | |
45 print(e) | |
43 ``` | 46 ``` |
44 | 47 |
45 ### Example output | 48 ### Example output |
46 ```json | 49 ```json |
47 { | 50 { |