editor.set_file_contents(name, new_contents[, root])
Writes new data to the file with the given name (a relative path). If a file with this name exists, it is overwritten.

Note that new_contents is a byte string, which means that you can also use this to write binary files (such as images), but if you write non-ASCII text, you have to encode it yourself.

root can be either ‘local’ or ‘dropbox’. ‘local’ is the default.