Generate text from console and save to a given location (requires record=True argument in constructor). Args: path (Union[str, PathLike[str]]): Path to write text files. clear (bool, optional): Clear record buffer after exporting. Defaults to ``True``. st
(
self,
path: Union[str, PathLike[str]],
*,
clear: bool = True,
styles: bool = False,
)
| 2222 | return text |
| 2223 | |
| 2224 | def save_text( |
| 2225 | self, |
| 2226 | path: Union[str, PathLike[str]], |
| 2227 | *, |
| 2228 | clear: bool = True, |
| 2229 | styles: bool = False, |
| 2230 | ) -> None: |
| 2231 | """Generate text from console and save to a given location (requires record=True argument in constructor). |
| 2232 | |
| 2233 | Args: |
| 2234 | path (Union[str, PathLike[str]]): Path to write text files. |
| 2235 | clear (bool, optional): Clear record buffer after exporting. Defaults to ``True``. |
| 2236 | styles (bool, optional): If ``True``, ansi style codes will be included. ``False`` for plain text. |
| 2237 | Defaults to ``False``. |
| 2238 | |
| 2239 | """ |
| 2240 | text = self.export_text(clear=clear, styles=styles) |
| 2241 | with open(path, "w", encoding="utf-8") as write_file: |
| 2242 | write_file.write(text) |
| 2243 | |
| 2244 | def export_html( |
| 2245 | self, |