WSSS_ResNet50 / tools /general /txt_utils.py
kittendev's picture
Upload 176 files
c20a1af verified
raw
history blame
438 Bytes
# Copyright (C) 2020 * Ltd. All rights reserved.
# author : Sanghyeon Jo <[email protected]>
def read_txt(path):
with open(path, 'r') as f:
return [line.strip() for line in f.readlines()]
def write_txt(path, data_list):
with open(path, 'w') as f:
for data in data_list:
f.write(data + '\n')
def add_txt(path, string):
with open(path, 'a+') as f:
f.write(string + '\n')