From 123a54f600ce8efeac32380b982456014a871715 Mon Sep 17 00:00:00 2001 From: priest05 <1844628207@qq.com> Date: Thu, 13 Aug 2020 22:22:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AA=E7=95=99=E4=B8=80=E7=BB=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 存储.ipynb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/存储.ipynb b/存储.ipynb index 73b20f7..59c884a 100644 --- a/存储.ipynb +++ b/存储.ipynb @@ -9,7 +9,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 15, "metadata": {}, "outputs": [], "source": [ @@ -46,7 +46,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 16, "metadata": {}, "outputs": [], "source": [ @@ -62,6 +62,10 @@ " return info_tuple\n", " # 保存数据\n", " def save_outsideSummary_datas(self, outsideSummary):\n", + " print('+++ [MyDB] delete from outsideSummary_realtime_datas') \n", + " self.cursor.execute('delete from outsideSummary_realtime_datas') \n", + " self.conn.commit()\n", + " \n", " sql = 'insert into outsideSummary_realtime_datas(currentConfirmedCount,confirmedCount,suspectedCount,curedCount,deadCount,suspectedIncr,currentConfirmedIncr,confirmedIncr,curedIncr,deadIncr) values(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)'\n", " res = self.get_outsideSummary_list_tuple(outsideSummary)\n", " print('+++ save_outsideSummary_datas, data len: %d' % len(res))\n", @@ -85,13 +89,14 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 17, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ + "+++ [MyDB] delete from outsideSummary_realtime_datas\n", "+++ save_outsideSummary_datas, data len: 1\n", "+++ save_outsideSummary_datas is over.\n" ]