本文實例講述了python創(chuàng)建臨時文件夾的方法。分享給大家供大家參考。具體實現(xiàn)方法如下:
import tempfile, os tempfd, tempname = tempfile.mkstemp('.suffix') os.write(tempfd, "aString")# or, if you want a file-object: os.fdopen(tempfd, 'w+') os.close(tempfd) os.unlink(tempname) 希望本文所述對大家的Python程序設(shè)計有所幫助。
新聞熱點
疑難解答
圖片精選