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 or retrieve online file content.
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.__path attribute.
Returns: | self.__path. ( String ) |
---|
This method is the property for self.__content attribute.
Returns: | self.__content. ( List ) |
---|
This method reads given file content and stores it in the content cache.
Parameters: | mode – File read mode. ( String ) |
---|---|
Returns: | Method success. ( Boolean ) |
This method writes content to defined file.
Parameters: | mode – File write mode. ( String ) |
---|---|
Returns: | Method success. ( Boolean ) |