手机
当前位置:查字典教程网 >脚本专栏 >python >python创建临时文件夹的方法
python创建临时文件夹的方法
摘要:本文实例讲述了python创建临时文件夹的方法。分享给大家供大家参考。具体实现方法如下:importtempfile,ostempfd,te...

本文实例讲述了python创建临时文件夹的方法。分享给大家供大家参考。具体实现方法如下:

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程序设计有所帮助。

【python创建临时文件夹的方法】相关文章:

python类定义的讲解

Python生成pdf文件的方法

pytyon 带有重复的全排列

Python实例之wxpython中Frame使用方法

python 文件与目录操作

Python获取当前时间的方法

python处理文本文件实现生成指定格式文件的方法

python解析html开发库pyquery使用方法

Python实现全局变量的两个解决方法

python切换hosts文件代码示例

精品推荐
分类导航