summaryrefslogtreecommitdiff
path: root/Code/utils.py
diff options
context:
space:
mode:
authorHui Lan <lanhui@zjnu.edu.cn>2024-08-07 11:54:45 +0800
committerHui Lan <lanhui@zjnu.edu.cn>2024-08-07 11:54:45 +0800
commite48a12c582bd8df222a74747c32c5a691b7e7782 (patch)
treee264354790126c9980e11c12f85c45475d9fde6f /Code/utils.py
parent4b64732ce6acdf75cf5b8469e42f15e625fee8b0 (diff)
Put the definition of make_paths() in utils.py because multiple places use it
Diffstat (limited to 'Code/utils.py')
-rw-r--r--Code/utils.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Code/utils.py b/Code/utils.py
index 3a89a8e..27922d0 100644
--- a/Code/utils.py
+++ b/Code/utils.py
@@ -37,6 +37,11 @@ def make_new_edges_file(Sold, Snew, fname_new, output_file):
f.write('*** Number of newly added edges: %d. Last modification date: %s. ***\n' % (len(result), datetime.now().strftime('%Y-%m-%d %H:%M')))
+def make_paths(s):
+ if not os.path.isdir(s):
+ os.makedirs(s)
+
+
if __name__ == '__main__':
S2 = get_edge_set('/home/lanhui/brain/Data/temp/edges.txt')
S1 = get_edge_set('/home/lanhui/brain/Data/temp/edges.txt.old')