Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 75c1325

Browse files
committed
added create_dir_if_nonexistent method to utils.py
1 parent 13a8799 commit 75c1325

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

worm_algorithm/utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
import matplotlib.pyplot as plt
55
import os
66

7+
def create_dir_if_nonexistent(path):
8+
if os.path.exists(path):
9+
print(f"Path {path} already exists, skipping.")
10+
else:
11+
print(f"Creating path: {path}")
12+
os.makedirs(path)
13+
714
#1D92cb
815

916
def errorbar_plot(values, labels, out_file, limits=None, Tc_line=None,

0 commit comments

Comments
 (0)