You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,34 @@ The following Python runtime versions (with kind & image labels) are generated b
32
32
33
33
This README documents the build, customization and testing of these runtime images.
34
34
35
+
So a very simple `hello world` function would be:
36
+
37
+
```python
38
+
defmain(args):
39
+
name = args.get("name", "stranger")
40
+
greeting ="Hello "+ name +"!"
41
+
print(greeting)
42
+
return {"greeting": greeting}
43
+
```
44
+
45
+
For the return result, not only support `dictionary` but also support `array`
46
+
47
+
So a very simple `hello array` function would be:
48
+
49
+
```python
50
+
defmain(args):
51
+
return ["a", "b"]
52
+
```
53
+
54
+
And support array result for sequence action as well, the first action's array result can be used as next action's input parameter.
55
+
56
+
So the function can be:
57
+
58
+
```python
59
+
defmain(args):
60
+
return args
61
+
```
62
+
35
63
To learn more about using Python actions to build serverless applications, check out the main project documentation [here](https://github.com/apache/openwhisk/blob/master/docs/actions-python.md).
0 commit comments