I have a file which contains a list of names stored in a simple text file. Each row contains one name. Now I need to pro grammatically append a new name to this file based on a users input. For the input itself I use DataBricks widgets - this is working just fine and I have the new name stored in a string object. Now I need to append this name to my file.
the file is mounted in the DataBricks File System (DBFS) under /mnt/blob/myNames.txt
when trying to read the file like this:
f = open("/mnt/blob/myNames.txt", "r")
print f
it returns an error "No such file or directory"
So I tried to wrap my new name into a dataframe and append it to the existing file but this also did not work as dataframe.write.save is designed to write into folders
what would be the most simple python could that I could use to append this new name to my file?