# [Python]讀寫檔案 ###### tags: `Python` ## 建立資料夾 ### 1. os.makedirs()可建立多個子目錄 ```python= import os os.makedirs('C:\\hello\\my\\world') ``` ### 2. Path().mkdir()僅建立一個目錄 ```python= from pathlib import Path Path('C:\\hello\\my\\world').mkdir() ``` 如果上述原本沒有C:\hello\my目錄的話,則會出現錯誤
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up