diff --git a/boom.py b/bomb.py similarity index 96% rename from boom.py rename to bomb.py index abe86b2..3f08934 100644 --- a/boom.py +++ b/bomb.py @@ -3,7 +3,7 @@ ''' Author: whalefall Date: 2021-08-07 21:23:35 -LastEditTime: 2021-08-09 19:12:32 +LastEditTime: 2021-08-10 17:10:07 Description: 异步轰炸 ''' import asyncio diff --git a/data.db b/db/data.db similarity index 100% rename from data.db rename to db/data.db diff --git a/db/data.json b/db/data.json new file mode 100644 index 0000000..e69de29 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..c77b65d --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +requests==2.24.0 +aiohttp==3.7.3 +pathlib diff --git a/utils/__pycache__/db_sqlite.cpython-38.pyc b/utils/__pycache__/db_sqlite.cpython-38.pyc index 9b32a1d..1d6ab8e 100644 Binary files a/utils/__pycache__/db_sqlite.cpython-38.pyc and b/utils/__pycache__/db_sqlite.cpython-38.pyc differ diff --git a/utils/db_sqlite.py b/utils/db_sqlite.py index d93cf86..6f980c7 100644 --- a/utils/db_sqlite.py +++ b/utils/db_sqlite.py @@ -3,18 +3,21 @@ ''' Author: whalefall Date: 2021-08-07 14:59:08 -LastEditTime: 2021-08-07 21:31:13 +LastEditTime: 2021-08-10 17:08:54 Description: python操作数据库 ''' import sqlite3 -import sys +from pathlib import Path class Sql(object): def __init__(self) -> None: '''初始化数据库''' + # 数据库路径 + db_path = Path.cwd().joinpath("db", "data.db") + # 连接数据库,不检查是否在同一个路径. self.client = sqlite3.connect( - "data.db", timeout=6, check_same_thread=False) + db_path, timeout=6, check_same_thread=False) self.cursor = self.client.cursor() self.newTable() @@ -67,3 +70,4 @@ if __name__ == "__main__": s = Sql() s.update("SWDWQ") print(s.select()) + # print(Path.cwd().joinpath("db","data.db"))