Python os.tmpfile() 方法 Python os.tempnam() 方法 Python os.tmpnam() 方法 Python os.tmpfile() 方法 # !/usr/bin/python import os # The file has no directory entries associated with it and will be # deleted automatically once there are no file descriptors. tmpfile = os.tmpfile() tmpfile.write('Temporary newfile is here.....') tmpfile.seek(0) print tmpfile.read() tmpfile.close Python os.tempnam() 方法 Python os.tmpnam() 方法