-
Notifications
You must be signed in to change notification settings - Fork 0
/
製作暫時換打掃股長選擇日期JSON.py
77 lines (65 loc) · 1.58 KB
/
製作暫時換打掃股長選擇日期JSON.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import json
FirstLayerBoxContents = [
{
"type": "text",
"text": "Li(1).選擇不幹的天數",
"size": "xl",
"weight": "bold"
},
{
"type": "text",
"text": "選從今天算起幾天不做",
"size": "md"
},
{
"type": "text",
"text": "例:8/24選好不幹5天,8/29就要開工",
"size": "xs"
},
{
"type": "text",
"text": "#在委託人同意前仍要工作",
"size": "md"
}
]
count = 0
SecondLayerBoxContent = []
for i in range(1,15):
SecondLayerBoxContent.append({
"type": "button",
"action": {
"type": "postback",
"label": "%i"%i,
"data": "DeleteingCleaningFinChooseAll&%i"%i
},
"margin": "none",
"height": "sm"
})
count = count+1
if count == 5:
FirstLayerBoxContents.append( {
"type": "box",
"layout": "horizontal",
"contents": SecondLayerBoxContent
})
count = 0
SecondLayerBoxContent = []
if i ==14:
FirstLayerBoxContents.append( {
"type": "box",
"layout": "horizontal",
"contents": SecondLayerBoxContent
})
data = {
"type": "bubble",
"body": {
"type": "box",
"layout": "vertical",
"contents": FirstLayerBoxContents,
"spacing": "xs",
"margin": "none"
}
}
print(data)
with open('打掃股長不幹天數選擇.json', 'w', encoding='utf-8') as f:
json.dump(data, f)