Go to the documentation of this file.00001
00002
00003 import shutil
00004 import tempfile
00005
00006 tmp = tempfile.TemporaryFile(mode='r+')
00007 tmp.write("This is a test\n")
00008 f = open("my_file.txt", 'w')
00009 tmp.seek(0)
00010 shutil.copyfileobj(tmp, f)