outPath = "output.txt" file = open(outPath, 'wb') if file: file.close() else: print "Error Opening File."