Advertisement
rfmonk

tempfile_NamedTemporaryFile.py

Jan 28th, 2014
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. #1/usr/bin/env python
  2.  
  3. # this is from The Python
  4. # Standard Library by example
  5. # ISBN13: 9780321767349
  6.  
  7. import os
  8. import tempfile
  9.  
  10. with tempfile.NamedTemporaryFile() as temp:
  11.     print 'temp:'
  12.     print ' ', temp
  13.     print 'temp.name:'
  14.     print ' ', temp.name
  15.  
  16. print 'Exists after close:', os.path.exists(temp.name)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement