On 3/12/2014 5:29 AM, zoom wrote:
2. Alternatively, a unique string could be generated to assure that no same file exists. I can see one approach to this is to include date and time in the file name. But this seems to me a bit clumsy, and is not unique, i.e. it could happen (at least in theory) that two processes finish in the same second.
I tend to use this method -- prepending the job name or targeting different directories per job precludes duplication. Unless you're running the same job at the same time, in which case tempfile is the way to go (which I use for archiving spooled print files which can occur simultaneously.)
Emile -- https://mail.python.org/mailman/listinfo/python-list