import os def exists_or_make_path(p): if not os.path.exists(p): os.makedirs(p)