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

danmcleran at yahoo.com danmcleran at yahoo.com
Thu Nov 11 19:38:32 CET 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