os.tmpfile() vs. tempfile.TemporaryFile()

danmcleran at yahoo.com danmcleran at yahoo.com
Thu Nov 11 13:38:32 EST 2010


On Nov 11, 11:32 am, John Nagle <na... at animats.com> wrote:
>    Is there any reason to prefer "tempfile.TemporaryFile()"
> over "os.tmpfile()"?  Both create a nameless temporary file
> that will be deleted on close.
>
>                                 John Nagle

tempfile.TemporaryFile has more options, e.g. file prefix, suffix, dir
location, mode, and buf size. if you don't care about any of that,
then it probably makes no difference.



More information about the Python-list mailing list