io.py
Others:
Parameters: | path – Directory path. ( String ) |
---|---|
Returns: | Definition success. ( Boolean ) |
Bases: object
This class provides methods to read / write and append to files.
Usage:
>>> file = File("file.txt")
>>> file.content = ["Some file content ...\n", "... ready to be saved!\n"]
>>> file.write()
True
>>> file.read()
>>> file.content
['Some file content ...\n', '... ready to be saved!\n']
Parameters: |
|
---|
This method is the property for self.__file attribute.
Returns: | self.__file. ( String ) |
---|
This method is the property for self.__content attribute.
Returns: | self.__content. ( List ) |
---|
This method reads given file content.
Parameters: | mode – File read mode. ( String ) |
---|---|
Returns: | Method success. ( Boolean ) |
This method reads given file content and returns it.
Parameters: | mode – File read mode. ( String ) |
---|---|
Returns: | File content. ( String ) |