Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #1/usr/bin/env python
- # this is from The Python
- # Standard Library by example
- # ISBN13: 9780321767349
- import tempfile
- with tempfile.TemporaryFile(mode='w+t') as f:
- f.writelines(['first\n', 'second\n'])
- f.seek(0)
- for line in f:
- print line.rstrip()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement