Script for export vertex in CSV dont work
Given that the error appears at opening the file, I strongly suspect that your outputFile is malformed:

Check that the path exists, the filename doesn't point to a directory, spaces in directory names are handled correctly etc.

You can paste the lines in the console one by one, the python interpreter will give you a verbose error message

Check these answers here

Where does console output go

Python script fail, look in the console for now