tepkit.io.TextFile

tepkit.io.TextFile#

class tepkit.io.TextFile#

Bases: File

The class for text files. The base class for StructuredTextFile and TableTextFile .

Attributes#

Attribute

Default Value

Description

content

None

Record the string of the textfile.

Methods#

from_string(→ tepkit.utils.typing_tools.Self)

Save the string to self.content and return the object.

from_file(→ tepkit.utils.typing_tools.Self)

Read the text file, and save its text to self.content.

All Members#

content: str | None = None

Record the string of the textfile.

classmethod from_string(string: str) Self

Save the string to self.content and return the object.

classmethod from_file(path: tepkit.utils.typing_tools.PathLike) Self

Read the text file, and save its text to self.content.