On Aug 2, 7:43 pm, William Stein <wst...@gmail.com> wrote:
> If the data is ephemeral, you could use the tempfile module.

Thanks! excellent suggestion. For future reference:

If you do:

import tempfile
F=tempfile.NamedTemporaryFile()

then you have a usable (existing) filename F.name

Beware that once the reference to F gets lost, the file gets deleted.
Pass "delete=false" to NamedTemporaryFile to avoid that (but then you
need to clean up yourself). An even dirtier version is

filename=tempfile.NamedTemporaryFile().name

which does give you a filename that is all likelyhood is usable and
probably nonexistent, but leaves you with a nasty racing condition
(see tempfile docs).

-- 
-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org



Reply via email to