File size: 481 Bytes
3f7c489 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import os
from natsort import natsorted
from glob import glob
def mkdirs(paths):
if isinstance(paths, list) and not isinstance(paths, str):
for path in paths:
mkdir(path)
else:
mkdir(paths)
def mkdir(path):
if not os.path.exists(path):
os.makedirs(path)
def mknod(path):
if not os.path.exists(path):
os.mknod(path)
def get_last_path(path, session):
x = natsorted(glob(os.path.join(path,'*%s'%session)))[-1]
return x |