回答編集履歴
1
追記
test
CHANGED
@@ -4,4 +4,30 @@
|
|
4
4
|
|
5
5
|
if (dict_json['report_num'] == '1') and (dict_json['report_time'] != BEFORE_dict_json['report_time']):
|
6
6
|
|
7
|
+
...
|
8
|
+
|
7
9
|
```
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
条件が長すぎて読みづらいのは事実なので、適当に関数を用意してやっても良いでしょう。
|
14
|
+
|
15
|
+
```Python
|
16
|
+
|
17
|
+
def cond(n_json, before_json): # 関数名は目的に合わせ適切に付け直してください
|
18
|
+
|
19
|
+
if n_json['report_num'] != '1':
|
20
|
+
|
21
|
+
return False
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
return n_json['report_time'] != before_json['report_time']
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
if cond(dict_json, BEFORE_dict_json):
|
30
|
+
|
31
|
+
...
|
32
|
+
|
33
|
+
```
|