os.path.join裏寫3個變量

os.path.join裏寫3個變量

注:

必須爲變量,不是變量需先定義爲變量

dst="/home/ming"

Images = "Images"

d = open('/log/aa.txt','r')
for e in d.readlines():
d.close()
if not os.path.exists(os.path.join(dst,e.strip(),Images)):
os.makedirs(os.path.join(dst,e.strip(),Images))

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章