python创建临时文件夹的方法
作者:pythoner 时间:2022-02-13 21:51:35
本文实例讲述了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,临时,文件夹
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
教你轻松了解MySQL数据库中的结果字符串
2009-02-23 17:29:00
SQL 2008的变更数据捕获——跟踪可变部分
2009-03-20 11:47:00
![](https://img.aspxhome.com/file/UploadPic/20093/2009322183639136.jpg)
学习win32com操作word之Range精讲
2021-05-13 11:36:58
![](https://img.aspxhome.com/file/2023/8/87548_0s.png)
python Django框架快速入门教程(后台管理)
2022-04-17 11:43:12
![](https://img.aspxhome.com/file/2023/2/76102_0s.png)
请谨慎对待程序的图标和名称
2011-06-16 20:35:22
一个二级伸缩下拉菜单代码
2008-06-24 18:12:00
python opencv人脸识别考勤系统的完整源码
2022-03-20 21:15:43
![](https://img.aspxhome.com/file/2023/4/103074_0s.jpg)
使用python opencv对目录下图片进行去重的方法
2023-07-06 20:04:13
原来CSS也可以把IE6弄死
2007-08-14 09:30:00
Python语法学习之进程的创建与常用方法详解
2023-11-08 11:23:34
![](https://img.aspxhome.com/file/2023/9/78609_0s.jpg)
Matlab中关于argmax、argmin函数的使用解读
2023-06-27 20:36:53
![](https://img.aspxhome.com/file/2023/3/107113_0s.png)
python模块和包的应用BASE_PATH使用解析
2021-04-15 09:46:36
python设计微型小说网站(基于Django+Bootstrap框架)
2023-03-15 01:54:18
![](https://img.aspxhome.com/file/2023/6/65046_0s.jpg)
详解python中*号的用法
2023-05-03 18:55:11
移动网站开发:标记语言
2010-06-08 13:42:00
![](https://img.aspxhome.com/file/UploadPic/20106/8/0pqh1z27_lit-15s.jpg)
Python中的集合介绍
2022-09-10 03:49:52
![](https://img.aspxhome.com/file/2023/1/101111_0s.png)
Python音乐爬虫完美绕过反爬
2022-12-30 06:53:45
![](https://img.aspxhome.com/file/2023/5/89215_0s.png)
网站的视觉设计
2008-08-15 12:58:00
执行python脚本并传入json数据格式参数方式
2021-12-09 21:22:14
![](https://img.aspxhome.com/file/2023/3/87873_0s.png)
粗暴解决CUDA out of memory的问题
2023-05-12 05:40:00