AbsReaderWriter.py 308 B

1234567891011121314151617181920
  1. from abc import ABC, abstractmethod
  2. class AbsReaderWriter(ABC):
  3. """
  4. 同时支持二进制和文本读写的抽象类
  5. TODO
  6. """
  7. @abstractmethod
  8. def read(self, path: str):
  9. pass
  10. @abstractmethod
  11. def write(self, path: str, content: str):
  12. pass