From 1abcd4f45c85f3dce6791e685bd02f1714d9ac40 Mon Sep 17 00:00:00 2001 From: jiangzhonglian Date: Fri, 15 Nov 2019 11:28:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96mysql=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 ++++ u_tool/u_mysql.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 894a44c..c47c59b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,10 @@ __pycache__/ *.py[cod] *$py.class +*.csv +*.xlsx +*.txt +*.mp3 # C extensions *.so diff --git a/u_tool/u_mysql.py b/u_tool/u_mysql.py index 33b581a..946ac9a 100644 --- a/u_tool/u_mysql.py +++ b/u_tool/u_mysql.py @@ -69,7 +69,7 @@ class MySQL: try: self.open() self.cur.execute("%s;" % sql, L) - self.cur.fetchall() + result = self.cur.fetchall() print("ok") msg = "success" except Exception as e: @@ -80,4 +80,4 @@ class MySQL: finally: self.close() # 返回统一状态 - return msg \ No newline at end of file + return result, msg -- GitLab