How do I use temp files?

Stasenndb

New member
How do I use temp files?
Answer
To achieve this, we can use the TemporaryFile() function.
  1. First, we have to import tempfile then the file is created using the TemporaryFile() function.
  2. The file is opened in w+b (both read and write to the open file)mode by default.
  3. This function creates a temporary file in the temp directory and returns a file object.
 

Tìm kiếm

Back
Top