Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Python: Using temporary file

Python: Using temporary file
{filelink=16052}

import tempfile
tempfile = tempfile.mktemp()
# get temp file path
print "tempfile", "=>", tempfile
file = open(tempfile, "w+b")
# write to temporary file
file.write("welcom" * 1000)
file.seek(0)
print len(file.read()), "bytes"
file.close()

Users who found this page were searching for:

  • java mail write mails in a folder
  • add dictionary entry python
  • labeled loop in java
  • pyhton create class
  • python mail reader
  • python write a temporary file
  • python send_file tempfile delete

No comments yet.

Leave a Comment