

I use if__name__main__ often when working with AWS Lambda, but I also want to run it locally. Lambda wants to call a function with the params event
and context
. So I would do something like this:
def handler(event, context):
things
return {
'statusCode': 200,
'body': 'Hello from Lambda!'
}
if __name__ == '__main__':
event = {}
context = {}
response = handler(event, context)
print(response)
Ah, that’s right. Antipasto is Italian or something for first course.