import os
save_path = os.path.join('images', 'my_image.png')
directory = os.path.dirname(save_path)
if not os.path.exists(dirctory):
os.makedir(directory)
python创建文件路径
于 2024-08-23 17:56:24 首次发布
import os
save_path = os.path.join('images', 'my_image.png')
directory = os.path.dirname(save_path)
if not os.path.exists(dirctory):
os.makedir(directory)