무회blog

os파일생성_및_사용법 본문

Python

os파일생성_및_사용법

최무회 2020. 6. 22. 11:20

import os
os.getcwd()
os.chdir('D:/app_src/anaconda/05-고정진행/')
os.getcwd()

 

 

checkFolder = os.path.isdir('./news001/news02/')
checkFolder00 = os.path.isdir('./news002/yibufen/')
checkFolder01 = os.path.isdir('./news002/quanbu/')

creatFolder_in = './news001/news02/'
creatFolder_out00 = './news002/yibufen/'
creatFolder_out01 = './news002/quanbu/'

 

 

if checkFolder == True:
pass
else:
os.mkdir(creatFolder_in)

 

if checkFolder00 == True:
pass
else:
os.mkdir(creatFolder_out00)

 

if checkFolder01 == True:
pass
else:
os.mkdir(creatFolder_out01)

Comments