Read and Write on File

I write this code:

def save(name):
    nameFile = name+’.txt’
    f = open(nameFile,‘w’)
    f = open(nameFile,‘r’)
    msg =

in python this code works, but on Zerynth I have a problem.
I debug the code and it stops before the instruction " f.write(name)". Why? How can I solve this problem ? Should I import some libraries?
thank you for all.

Hi virginiodv,
you should take a look at Zerynth Filesystem example :wink:
The open function is currently implemented under the os module
which needs a mounted filesystem to correctly work, so you may need an SD card to write your files to:  
Let me know if this helps :slight_smile: