writeLines

writeLines(text, con, type='wt')

Write text to a file

Args: text (str): The text to write to a file con (str): The path to the file type (str): String indicating how to open the file. Defaults to ‘wt’

Returns: the path to the file where the text is stored

Examples: >>> from rlike import * >>> f = writeLines(text = ‘Hello world. Some more text.’, con = ‘fname.txt’) >>> x = readLines(‘fname.txt’) >>> x [‘Hello world. Some more text.’] >>> f = writeLines(text = [‘I’, ‘want’, ‘to’, ‘break free.’], con = ‘fname.txt’) >>> x = readLines(‘fname.txt’) >>> x [‘I’, ‘want’, ‘to’, ‘break free.’]