小编jaj*_*jdp的帖子

Create a temporary file with unique name using Python 3?

I would like to create a temporary file with an specific name (and if its possible with an specific extension).

Example:

-mytempfile.txt
-mytempfile2.xml
Run Code Online (Sandbox Code Playgroud)

I've been reading about tempfile library, but as far as I know I can only set the following parameters

(mode='w+b', buffering=None, encoding=None, newline=None, suffix=None, prefix=None, dir=None)
Run Code Online (Sandbox Code Playgroud)

python file temp python-3.x

1
推荐指数
1
解决办法
3136
查看次数

标签 统计

file ×1

python ×1

python-3.x ×1

temp ×1