Python中os.path和os.makedirs的运用(判断文件或文件夹是否存在,建立文件夹)

import os import numpy as np data = np.array([1, 2, 3]) if not os.path.exists("./data/"): print("# path not exists") os.makedirs("./data/") if not os.path.exists("./data/data.npy"):
相关文章
相关标签/搜索