最有效腾讯云函数python __main__ 运行

1
最有效腾讯云函数if __name__ == "__main__":运行

代码

1
2
3
4
5
6
7
8
9
# -*- coding: utf8 -*-
import json
def main_handler(event, context):
print("Received event: " + json.dumps(event, indent = 2))
print("Received context: " + str(context))
print("Hello world")
return("Hello World")
if __name__ == "__main__":
main_handler("","")