aboutsummaryrefslogtreecommitdiff
path: root/qolab/file_utils
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2024-06-19 15:51:00 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2024-06-19 15:51:00 -0400
commitb52ce432aeb42f1134451374aac11359183e7006 (patch)
treebc28ce5884c74344d60be4fd167565720f216b09 /qolab/file_utils
parent47a630c4044ee30e55e8eb1ae95ad132b08ac162 (diff)
downloadqolab-b52ce432aeb42f1134451374aac11359183e7006.tar.gz
qolab-b52ce432aeb42f1134451374aac11359183e7006.zip
switch file saving to binary mode
Diffstat (limited to 'qolab/file_utils')
-rw-r--r--qolab/file_utils/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/qolab/file_utils/__init__.py b/qolab/file_utils/__init__.py
index 8d19415..45bcd4b 100644
--- a/qolab/file_utils/__init__.py
+++ b/qolab/file_utils/__init__.py
@@ -74,7 +74,7 @@ def save_table_with_header(fname, data, header='', comment_symbol='%', skip_head
fname = filename2os_fname(fname)
file_exist_flag = os.path.exists(fname)
item_format=str.join('', ['{', f':{item_format}', '}'])
- with open(fname, 'a') as f:
+ with open(fname, 'ab') as f:
if not (file_exist_flag and skip_headers_if_file_exist):
for l in header:
f.write(f'{comment_symbol} {l}\n')