title: How to make sure a file exists or can be created before writing to it in Python?
body: <p>I'm writing a function and I want it to <code>touch</code> a file so that I can write to that file. If the file doesn't exist, I will get an error. How can I say that?</p>