Your question is not really clear, try to edit it a little to make it better.
In general, you don't need to create the file before you start your program, the 'w' option will write to that file, and will create the file if it doesn't exist.
Now, if you just want to create an empty file, use the 'x' option, as follows:
f = open("yourfile.txt", "x")
You can create all the files that you want with this, even without closing the handle.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…