I have a quick question about Python tempfile.
When shoudl I use tempfile? If I use tempfile.mkstemp to create a temporary file, is this same as a normal file? What are the differences? Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The documentation pretty much says it all. In my view, you should use
tempfilewhen you need to create a file but don’t care about its name. You can have the file deleted automatically when you’re done or saved, if you wish. It can also be visible to other programs or not.