Python / tempfile === ###### tags: `Python` ###### tags: `Python`, `tempfile`, `TemporaryDirectory`, `cleanup`, `建立暫存目錄` <br> [TOC] <br> ```python= import tempfile tmp = tempfile.TemporaryDirectory() try: # do something cache_dir=tmp.name # ... finally: tmp.cleanup() ``` - `tmp` `<TemporaryDirectory '/tmp/tmpf8aqwtak'>` <br> {%hackmd vaaMgNRPS4KGJDSFG0ZE0w %}
×
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