12345678910111213141516171819202122232425262728 |
- import os,sys,re,json
- # import mysql
- class Db():
- '''Db接口'''
- def __init__(self):
- pass
-
- def save(domain:str, res:bool):
- pass
- class File(Db):
- '''文件保存结果'''
- def save(self, filePath: str, res: str):
- # super().save(res)
- with open(filePath,'a+',encoding='utf-8') as file:
- file.writelines(res+"\n")
- class Mysql(Db):
- '''mysql数据库保存数据库'''
- def save(domain: str, res: bool):
- return super().save(res)
- class Sqlite(Db):
- '''sqlite保存'''
- def save(domain: str, res: bool):
- return super().save(res)
|