mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
allow for same file to be read in as ascii and output as binary
This commit is contained in:
parent
ee514f5d99
commit
18f42076fb
1 changed files with 4 additions and 2 deletions
|
|
@ -18,9 +18,8 @@ def ascii_to_binary(ascii_file, binary_file):
|
|||
|
||||
"""
|
||||
|
||||
# Open ASCII and binary files
|
||||
# Open ASCII file
|
||||
ascii = open(ascii_file, 'r')
|
||||
binary = open(binary_file, 'wb')
|
||||
|
||||
# Set default record length
|
||||
record_length = 4096
|
||||
|
|
@ -29,6 +28,9 @@ def ascii_to_binary(ascii_file, binary_file):
|
|||
lines = ascii.readlines()
|
||||
ascii.close()
|
||||
|
||||
# Open binary file
|
||||
binary = open(binary_file, 'wb')
|
||||
|
||||
idx = 0
|
||||
while idx < len(lines):
|
||||
# Read/write header block
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue