[Python] How to create a named temporary file in memory?
- by conradlee
I would like to use Python's tempfile module to create a temporary file that I will use for communication between processes (use of pipes is awkward).
The documentation I've linked to above shows two functions that almost do what I want:
tempfile.NamedTemporaryFile # For creating named tempfiles
tempfile.SpooledTemporaryFile # For creating tempfiles in memory
but actually I want a tempfile that is both named AND in memory. Any ideas?