-
Notifications
You must be signed in to change notification settings - Fork 1
/
display_half.py
57 lines (49 loc) · 1.96 KB
/
display_half.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
import script
import helper
def merge_ingredient(ingredient):
return str(ingredient['quantity'])+ ingredient['measurement']+ ingredient['ingredient_name']+ingredient['preparation']
def display(ingredients, tools, methods, steps):
ingredients = helper.cut_ingredient_size(ingredients)
print('-------Ingredients-----')
for ingredient in ingredients:
print(merge_ingredient(ingredient).rstrip(','))
print('..........')
print('name:', ingredient['ingredient_name'].rstrip(','))
print('quantity:', ingredient['quantity'])
print('measurement:', ingredient['measurement'])
print('preparation:', ingredient['preparation'])
print()
print('\n-------Tools-----')
for tool in tools:
print(tool)
print('\n-------Methods-----')
for method in methods:
print(method)
print('\n-------Steps------')
cnt = 1
for step in steps:
print("step", cnt)
print(step[0].strip())
print('..........')
if len(step[1]['ingredient']) != 0:
print('ingredients: ', end = '')
for ing in step[1]['ingredient'][:-1]:
print(ing.strip(), end = ', ')
print(step[1]['ingredient'][-1])
if len(step[1]['cooking tools']) != 0:
print('cooking tools: ', end = '')
for ing in step[1]['cooking tools'][:-1]:
print(ing.strip(), end = ', ')
print(step[1]['cooking tools'][-1])
if len(step[1]['cooking methods']) != 0:
print('cooking methods: ', end = '')
for ing in step[1]['cooking methods'][:-1]:
print(ing.strip(), end = ', ')
print(step[1]['cooking methods'][-1])
if len(step[1]['time']) != 0:
print('cooking time: ', end = '')
for ing in step[1]['time'][:-1]:
print(ing.strip(), end = ', ')
print(step[1]['time'][-1])
print()
cnt+=1