Script for export vertex in CSV dont work I'm quite new in the blender and many things I do not understand yet.
I would like to extract the coordinates of each vertex in CSV
Well... I'm trying to use this script, but I can not make it work, supposedly copying / pasting it and pressing the "run" button should work, but there's no way. 

Surely it is a very basic question, but the truth is, I have no idea.

I do not even know how to write the code correctly on this page :(
  (but I just found out ^^ )



import bpy

outputFile = 'C:/someFolder/mesh.csv'

verts = [ bpy.context.object.matrix_world * v.co for v in bpy.context.object.data.vertices ]

csvLines = [ ";".join([ str(v) for v in co ]) + "\n" for co in verts ]

f = open( outputFile, 'w' )
f.writelines( csvLines )
f.close()




It always gives the same error in line #9  :



Thanks for reading this, any help will be very grateful. A greeting!
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