Python中文
首页
教程
问答
标签
搜索
登录
注册
如何使用python2.7在awslambda中编写helloworld示例?
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我完全被AWS中的文档搞糊涂了。在</p> <h2>我尝试了什么</h2> <ol> <li>使用us-west-2地区注册了一个AWS帐户</li> <li>创建了一个名为helloworld的Lambda函数</li> </ol> <p><a href="https://i.stack.imgur.com/l8Ux5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/l8Ux5.png" alt="enter image description here"/></a></p> <ol start=“3”> <li>在内部创建了一个名为<code>hello_world</code>的处理程序。在</li> </ol> <p><a href="https://i.stack.imgur.com/wAlNZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wAlNZ.png" alt="enter image description here"/></a></p> <ol start=“4”> <li>所选操作>;配置测试事件>;所选公用>;Hello World</li> </ol> <p><a href="https://i.stack.imgur.com/Dri7u.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Dri7u.png" alt="enter image description here"/></a></p> <ol start=“5”> <li><p>按Test,我得到以下错误消息:</p> <p>下面的区域显示了函数执行返回的结果。 { “errorMessage”:“模块'helloworld'语法错误” }</p></li> </ol> <p><a href="https://i.stack.imgur.com/7e0Y3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7e0Y3.png" alt="enter image description here"/></a></p> <p>以及</p> <pre><code>START RequestId: f71b8c46-ecc8-11e5-91b6-c55c85fd12cb Version: $LATEST Syntax error in module 'helloworld': invalid syntax (helloworld.py, line 1) END RequestId: f71b8c46-ecc8-11e5-91b6-c55c85fd12cb REPORT RequestId: f71b8c46-ecc8-11e5-91b6-c55c85fd12cb Duration: 0.29 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 10 MB </code></pre> <p><a href="https://i.stack.imgur.com/FTQT5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FTQT5.png" alt="enter image description here"/></a></p> <h2>我想要什么</h2> <p>我只想成功地执行pythonhelloworld,这样我就知道应该在哪里观察输出以及如何运行脚本。在</p> <h2>更新</h2> <p>我把密码改成</p> ^{pr2}$ <p>而且执行得很好。在</p> <p>我看到的是:</p> <pre><code>START RequestId: 33bf2a83-ecda-11e5-bdcd-2de843a18bed Version: $LATEST {u'key3': u'value3', u'key2': u'value2', u'key1': u'value1'} <__main__.LambdaContext object at 0x7f66d1848990> END RequestId: 33bf2a83-ecda-11e5-bdcd-2de843a18bed </code></pre> <p>作为第二个param出现的LamdaContext对象到底是什么?在</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>对于python函数:</p> <p><code> def helloworld(): print "helloworld" </code></p> <p>然后,在配置中,您应该使用“helloworld”作为lambda处理程序。在</p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
如何添加虚拟方法
10 回答
如何添加表示整数的擦边字符串?
8 回答
如何添加要在Bokeh中使用的新font.ttf文件?
7 回答
如何添加要显示的矩阵XY轴编号和XY轴
9 回答
如何添加计数?
9 回答
如何添加计数器函数?
7 回答
如何添加计数器列来计算数据帧中另一列中的特定值?
5 回答
如何添加计数器来跟踪while循环中的月份和年份?
10 回答
如何添加计数并删除countplot的顶部和右侧脊椎?
4 回答
如何添加计时器wx.应用程序更新窗口对象的主循环?
8 回答
如何添加评论到帖子?PostDetailVew,Django 2.1.5
9 回答
如何添加评论拉梅尔亚姆
3 回答
如何添加诸如矩阵Python/Pandas之类的数据帧?
4 回答
如何添加谷歌地点自动完成到Flask?
6 回答
如何添加超时、python discord bot
4 回答
如何添加超过1dp的检查
5 回答
如何添加距离方法
4 回答
如何添加跟随游戏的敌人精灵
3 回答
如何添加路径以便python可以找到程序?
2 回答
如何添加身份验证/安全性以使用happybase访问HBase?
7 回答