Python version :Python 3.6.0 :: Anaconda 4.3.1 (64-bit)
System version :Windows 10
System version :Windows 10
# create dir
def mkdir(path):
import os
if os.path.exists(path) == False:
os.makedirs(path)
print('mkdir:',path)
elif os.path.exists(path) == True:
print('dir already exist:',path)
mkdir(r'E:\download\tmp\test123')
執行結果:
mkdir: E:\download\tmp\test123 or dir already exist: E:\download\tmp\test123
沒有留言:
張貼留言