Writing in textfile

Hi

i just write my first kodi script to control the RPI.GPIO. i want to control LED Stripes which are connected to my GPIOS with my FHEM server.

I want to write some data in a Textfile. which is laying in “/storage/.kodi/script.service.ledstripe/resources/data/textfile.txt”. But i always get the error “Error Contents: (2, ‘No such file or directory’….” i thought i can just put my path to “resources/data/textfile.txt” but wont work too.

can someone help me?
Same thing is with loading data into a the python script.

thx