From b652639aae47c2802aa5b74eda37f5314184a6b1 Mon Sep 17 00:00:00 2001 From: xieshen <1397910458@qq.com> Date: Mon, 19 Oct 2020 14:43:13 +0800 Subject: [PATCH] =?UTF-8?q?#=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- monitor/views.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/monitor/views.py b/monitor/views.py index d1e6253..2411af4 100644 --- a/monitor/views.py +++ b/monitor/views.py @@ -163,11 +163,11 @@ def test_json(request): if len(x) > 1 and x != '\r\n': c[x] += 1 for (k, v) in c.most_common(200): # 遍历输出高频词 - print('%s%s %s %d' % (' ' * (5 - len(k)), k, '*', v)) - o = dict() - o['name'] = k - o['value'] = v - res.append(o) + if all(map(lambda c:'\u4e00' <= c <= '\u9fa5',k)): + o = dict() + o['name'] = k + o['value'] = v + res.append(o) return HttpResponse(json.dumps({ "res": res }))