如何在資料夾不存在時自動新增?
如何在資料夾不存在時自動新增?代碼錯誤如下:
datd =open('./55/url.txt','a',encoding='UTF-8')
FileNotFoundError: [Errno 2] No such file or directory: './55/url.txt'

a2='yes' print(a2) datd =open('./55/url.txt','a',encoding='UTF-8') print(a2,file=datd) datd.close()