Advertisement
rfmonk

tempfile_TemporaryFile_binary.py

Jan 28th, 2014
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3.  
  4. # import os
  5. # why does he import os then not use it?
  6. # I commented it out because it appears
  7. # unnecesary
  8. import tempfile
  9.  
  10. with tempfile.TemporaryFile() as temp:
  11.     temp.write('Some data')
  12.     temp.seek(0)
  13.  
  14.     print temp.read()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement