source:
ammosreader/scripts/pdw_reader.py@
008dcb7
Last change on this file since 008dcb7 was 083cf10, checked in by , 2 years ago | |
---|---|
|
|
File size: 594 bytes |
Line | |
---|---|
1 | import sys |
2 | |
3 | from ammosreader.PDW import PDW |
4 | |
5 | def main(): |
6 | |
7 | if len(sys.argv) != 2: |
8 | print("Specify name of .ppdw file") |
9 | sys.exit() |
10 | |
11 | file_name = sys.argv[1] |
12 | |
13 | with open(file_name, 'rb') as f: |
14 | |
15 | while(True): |
16 | current_bytes = f.read(32) |
17 | if current_bytes == '': |
18 | print("End of file detected") |
19 | break |
20 | if len(current_bytes) != 32: |
21 | print("Can not read all 32 bytes of next PDW") |
22 | break |
23 | |
24 | current_pdw = PDW.from_bytes(current_bytes) |
25 | print(current_pdw) |
Note:
See TracBrowser
for help on using the repository browser.