I am attempting to use the \'tempfile\' module for manipulating and creating text files. Once the file is ready I want to save it to disk. I thought it would be as simple as usi
You could always use shutil.copyfileobj, in your example:
new_file = open('bar.txt', 'rw') shutil.copyfileobj(f, new_file)