AbsReaderWriter.py 308 Bytes
Newer Older
kernel.h@qq.com's avatar
kernel.h@qq.com committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

from abc import ABC, abstractmethod


class AbsReaderWriter(ABC):
    """
    同时支持二进制和文本读写的抽象类
    TODO
    """
    @abstractmethod
    def read(self, path: str):
        pass

    @abstractmethod
    def write(self, path: str, content: str):
        pass