Writing file to folder?

for addon when reading writing file
how do you force it to use the local folder where the blende file is located ?
right now it is going where the EXE blender is located for 2.82 !

thanks
happy bl

solved
just change the file name in the open command!

##############

got this old thing
but still not writing in local folder ?

blendfilepath = bpy.data.filepath

print ()
print ('blendfilepath = ', blendfilepath )
print ()

directory = os.path.dirname(blendfilepath)
starfile = os.path.join( directory , “protagonist.csv”)

print ()
print ('directory = ', directory )
print ()
print ('starfile = ', starfile )
print ()

how to force it to the local folder ?

thanks
happy bl

1 Like