Home | Trees | Indices | Help |
---|
|
Creates a temporary file for a 'with' block. The file is deleted when the block exits. This creates the file to ensure it exists/block a race, but does not write anything to it, nor does it keep it open. It is intended for times when you need a named file for subprocesses.
Example:
with fs.NamedTempFile() as nm: proc.call( "curl http://mortoray.com/ -o {}".format( nm ) ) html = open(nm).read() print( len(html) )
|
|||
|
|||
|
|||
|
|
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Fri Feb 7 14:12:10 2014 | http://epydoc.sourceforge.net |