From b1a979b14833c3238142bc8dc3ec8036117dd4d1 Mon Sep 17 00:00:00 2001 From: dellpc <3462332305@qq.com> Date: Thu, 17 Mar 2022 16:36:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E7=9A=84=E5=9F=BA=E6=9C=AC=E6=A1=86=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dcs/tests/database.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dcs/tests/database.py b/dcs/tests/database.py index 29d4b53..cb15bf4 100644 --- a/dcs/tests/database.py +++ b/dcs/tests/database.py @@ -63,6 +63,18 @@ def login(): print(e) +def cancel(): + try: + conn = mysql_conn() + cur = conn.cursor() + select_sql = f'delete from sh_users where username = "{u_name}"' + cur.execute(select_sql) + cur.close() + conn.close() + except Exception as e: + print(e) + + if __name__ == '__main__': u_name = input('请输入用户名') u_pwd = input('请输入密码')