mmengine.fileio.put_text¶ mmengine.fileio.put_text(obj, filepath, backend_args=None)[source]¶ Write text to a given filepath with ‘w’ mode. Note put_text should create a directory if the directory of filepath does not exist. Parameters obj (str) – Data to be written. filepath (str or Path) – Path to write data. encoding (str, optional) – The encoding format used to open the filepath. Defaults to ‘utf-8’. backend_args (dict, optional) – Arguments to instantiate the corresponding backend. Defaults to None. Return type None Examples >>> filepath = '/path/of/file' >>> put_text('hello world', filepath)