Write on a file without erase what was before on it
-
Hi,
Now that the SD card is available on the Wipy, I am searching the command to write on a file without erase what was on it before, someone can help me ?
Thank you
Meide
-
Look for the files modes in open.
"w" will open it and eras the previous content
"a" will open it and append the new content to the end
"r+" will open it for reading and writing.
You may set the position to read or write with f.seek()
-
Thank you ! I will try that :)
-
@Meide
look here https://docs.python.org/3/tutorial/inputoutput.html
look atseek