Goku Coding Experience
Wednesday, 17 June 2020
How to remove and create folder at the same time in python?
import os
opath = 'output/images'
if os.path.exists(opath):
shutil.rmtree(opath) # delete output folder
os.makedirs(opath) # make new output folder
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment