Updated on 2025-12-10 GMT+08:00
Python Function Template
Python Function
The following is a sample code template of a Python function:
# -*- coding:utf-8 -*-
import json
def handler (event, context):
return {
"statusCode": 200,
"isBase64Encoded": False,
"body": json.dumps(event),
"headers": {
"Content-Type": "application/json"
}
}
When you create an empty Python event function on the FunctionGraph console, the preceding sample code is deployed by default.
Parent topic: Python
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot