Advertisement
Fhernd

carpeta-archivo-temporal.py

Jul 19th, 2018
1,949
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. from tempfile import TemporaryFile, NamedTemporaryFile
  2.  
  3. with TemporaryFile('w+t') as f:
  4.     f.write('Python es tremendo!\n')
  5.     f.write('La era Python ha empezado!\n')
  6.  
  7.     f.seek(0)
  8.     print(f.read())
  9.  
  10. with NamedTemporaryFile('w+t') as f:
  11.     print(f.name)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement