AmmosSource
guix
Last change
on this file since 1e781ba was 1e781ba, checked in by recknagel <recknagel@…>, 3 years ago |
former radardex-project
|
-
Property mode
set to
100644
|
File size:
650 bytes
|
Rev | Line | |
---|
[1e781ba] | 1 | import os
|
---|
| 2 | import sys
|
---|
| 3 | sys.path.insert(0, os.path.abspath('../'))
|
---|
| 4 |
|
---|
| 5 | from PDW import PDW
|
---|
| 6 |
|
---|
| 7 | if __name__ == '__main__':
|
---|
| 8 |
|
---|
| 9 | if len(sys.argv) != 2:
|
---|
| 10 | print("Specify name of .ppdw file")
|
---|
| 11 | sys.exit()
|
---|
| 12 |
|
---|
| 13 | file_name = sys.argv[1]
|
---|
| 14 |
|
---|
| 15 | with open(file_name, 'rb') as f:
|
---|
| 16 |
|
---|
| 17 | while(True):
|
---|
| 18 | current_bytes = f.read(32)
|
---|
| 19 | if current_bytes == '':
|
---|
| 20 | print("End of file detected")
|
---|
| 21 | break
|
---|
| 22 | if len(current_bytes) != 32:
|
---|
| 23 | print("Can not read all 32 bytes of next PDW")
|
---|
| 24 | break
|
---|
| 25 |
|
---|
| 26 | current_pdw = PDW.from_bytes(current_bytes)
|
---|
| 27 | print(current_pdw)
|
---|
Note:
See
TracBrowser
for help on using the repository browser.