手机
当前位置:查字典教程网 >脚本专栏 >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操作xml文件示例

python 实现归并排序算法

python 提取文件的小程序

从零学python系列之从文件读取和保存数据

Python文件夹与文件的操作实现代码

python合并文本文件示例

python 字符串格式化代码

使用python的chardet库获得文件编码并修改编码

python文件和目录操作方法大全(含实例)

python切换hosts文件代码示例

精品推荐
分类导航