I\'m trying to open a file, and if the file doesn\'t exist, I need to create it and open it for writing. I have this so far:
#open file for reading fn = input(\"
Here's a quick two-liner that I use to quickly create a file if it doesn't exists.
if not os.path.exists(filename): open(filename, 'w').close()