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" ]