我写了以下代码:
def incr_num(x, y):
while x <= y:
print x
incr_num(x+1, y)
Run Code Online (Sandbox Code Playgroud)
当我调用它时
incr_num(1, 10)
Run Code Online (Sandbox Code Playgroud)
它进入一个无限循环并给出这个输出:
1
2
3
4
5
6
7
8
9
10
10
10
10
10
10
10
(number 10 keeps repeating)
Run Code Online (Sandbox Code Playgroud)
我期待它打印数字1-10.我无法理解为什么不这样做.有人可以告诉我为什么会这样.
我正在使用python2.7.
在我们公司的标准Elasticsearch和策展人实施之上,我们有一个自定义包装器。我想知道当默认的“时间单位”设置为“天”时,策展人处理“每月/每周”索引的行为是什么。
**我无法覆盖默认的“时间单位”
这是我们每月/每周索引命名方式的示例格式
月度索引格式
logstash-test-monthly-2018.01
logstash-test-monthly-2018.02
logstash-test-monthly-2018.03
logstash-test-monthly-2018.04
...
...
logstash-test-monthly-2018.12
Run Code Online (Sandbox Code Playgroud)
每周索引格式
logstash-test-weekly-2018.01
logstash-test-weekly-2018.02
...
...
...
logstash-test-weekly-2018.51
logstash-test-weekly-2018.52
Run Code Online (Sandbox Code Playgroud)
Delete_Index.yml-馆长删除说明
actions:
1:
action: delete_indices
options:
ignore_empty_list: true
filters:
- exclude: true
filtertype: kibana
- exclude: false
kind: regex
filtertype: pattern
value: .*-monthly-.*
- range_to: 0
filtertype: period
source: name
range_from: -60
period_type: relative
timestring: '%Y.%m.%d'
exclude: true
unit: days
description: Delete indices more than X days old
2:
action: delete_indices
options:
ignore_empty_list: true
filters:
- exclude: true
filtertype: kibana
- …Run Code Online (Sandbox Code Playgroud)