Save verts as CSV file in 2.8?

I get an error on the path name in 2.8
and this should work only on the elected object !

import bpy

outputFile = ‘H:\Users\richa)script-218-2\Verts-save-CSV/verts.csv’

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

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

f = open( outputFile, ‘w’ )
f.writelines( csvLines )

can some one help to make this work in 2.8

after changing name to just file name to save in local folder
I get another error

TypeError: Element-wise multiplication: not supported between ‘Matrix’ and ‘Vector’ types

happy bl

For matrix-vector multiplication, Python now uses the ‘@’ operator…

So instead of:
verts = [ bpy.context.object.matrix_world * for v in ]

you should use:
verts = [ bpy.context.object.matrix_world @ for v in ]

1 - when you add text in py file I get an error like this

SyntaxError: (unicode error) ‘unicodeescape’ codec can’t decode bytes in position 573-574: truncated \UXXXXXXXX escape

do you know how to detect and correct these errors ?

2 - for verts data is it necessary to do the multiply ?
this gives the local coordinates
I guess otherwise you’d get the world values !

happy bl

1- Your path is wrong. Fix the \'s (better to use \\) and don’t mix them with /
it’s a Python error, so looking into the python manual will help.

2- for local coordinates, matrix_world @ for world coordinates, and if you want vertex coordinates with modifiers, animations, etc applied, you need to evaluate_get with the depsgraph (read the blender api manual!)