Answers for "python tempfile"

0

python tempfile

import os
import tempfile

fd, path = tempfile.mkstemp()
try:
    with os.fdopen(fd, 'w') as tmp:
        # do stuff with temp file
        tmp.write('stuff')
finally:
    os.remove(path)
Posted by: Guest on April-24-2022

Python Answers by Framework

Browse Popular Code Answers by Language